<?xml version="1.0"?>

<!--
This defines various CTSM-specific system tests
-->

<config_test>

  <test NAME="FUNITCTSM">
    <DESC>Run CTSM's Fortran unit tests. Grid and compset (and most case settings) are ignored.</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <STOP_OPTION>ndays</STOP_OPTION>
    <STOP_N>11</STOP_N>
    <CHECK_TIMING>FALSE</CHECK_TIMING>
    <DOUT_S>FALSE</DOUT_S>
  </test>

  <test NAME="LII">
    <DESC>CLM initial condition interpolation test (requires configuration with non-blank finidat)</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

  <test NAME="LII2FINIDATAREAS">
    <DESC>CLM initial condition interpolation test using finidat_areas (requires configuration with non-blank finidat)</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

  <test NAME="LILACSMOKE">
    <DESC>CTSM test: Smoke test of building and running CTSM via LILAC. Grid and compset (and most case settings) are ignored.</DESC>
    <!-- Many of the options are irrelevant here, but we define them for consistency with other tests -->
    <INFO_DBUG>1</INFO_DBUG>
    <STOP_OPTION>ndays</STOP_OPTION>
    <STOP_N>11</STOP_N>
    <CHECK_TIMING>FALSE</CHECK_TIMING>
    <DOUT_S>FALSE</DOUT_S>
  </test>

  <test NAME="LVG">
    <DESC>CLM test: Verify that adding virtual glacier columns doesn't change answers</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <!-- Need HIST_OPTION=never for this test because we expect answer changes
         in the l2x fields that are separated by elevation class. So for this
         test, we just ensure that there are no answer changes in
         gridcell-average CLM fields, via comparison of the CLM history
         files. This means that, for this test to be effective, it needs to be
         done with a testmod that produces at least one CLM history file, which
         should only contain gridcell-average fields. (If we had a way to
         exclude individual fields from the list of compared fields, then we
         could compare cpl hist files, excluding certain l2x fields.) -->
    <HIST_OPTION>never</HIST_OPTION>
  </test>

  <test NAME="LCISO">
    <DESC>CTSM Land model test to ensure Carbon isotopes on or off does NOT change answers</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

  <test NAME="LWISO">
    <DESC>CTSM Land model test to ensure Water isotopes on or off does NOT change answers</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

<!--
SSP    smoke CLM spinup test (only valid for CLM compsets with CLM45)
       do an initial spin test (setting CLM_ACCELERATED_SPINUP to on)
         write restarts at the end of the run
         short term archiving is on
       do a hybrid non-spinup simulation run from the restart files generated in the first phase
-->

  <test NAME="SSP">
    <DESC>smoke CLM spinup test</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <STOP_OPTION>ndays</STOP_OPTION>
    <RUN_TYPE>startup</RUN_TYPE>
    <STOP_N>4</STOP_N>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

  <test NAME="SSPMATRIXCN">
    <DESC>smoke CLM CN-Matrix spinup test</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <STOP_OPTION>nyears</STOP_OPTION>
    <RUN_TYPE>startup</RUN_TYPE>
    <DATM_CLMNCEP_YR_ALIGN>2000</DATM_CLMNCEP_YR_ALIGN>
    <DATM_CLMNCEP_YR_START>2000</DATM_CLMNCEP_YR_START>
    <DATM_CLMNCEP_YR_END>2001</DATM_CLMNCEP_YR_END>
    <STOP_N>5</STOP_N>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
  </test>

  <test NAME="SOILSTRUCTUD">
    <DESC>CLM user-defined soil structure test</DESC>
    <INFO_DBUG>1</INFO_DBUG>
    <DOUT_S>FALSE</DOUT_S>
    <CONTINUE_RUN>FALSE</CONTINUE_RUN>
    <REST_OPTION>never</REST_OPTION>
    <HIST_OPTION>$STOP_OPTION</HIST_OPTION>
    <HIST_N>$STOP_N</HIST_N>
  </test>

</config_test>
