Skip to content

Commit

Permalink
Merge branch 'simple_bfb_v2'
Browse files Browse the repository at this point in the history
Minor bug fixes, cleanup, documentation and enhancements

A collection of minor bug fixes, code cleanup, documentation and
enhancements, all bit-for-bit. See list of issues fixed below for
details.

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)
  • Loading branch information
billsacks committed Aug 4, 2018
2 parents b043949 + 8998341 commit 8ad23e5
Show file tree
Hide file tree
Showing 26 changed files with 237 additions and 141 deletions.
61 changes: 34 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# directories checked out by manage_externals, and other files created
# by manage_externals
manage_externals.log
src/fates/
tools/PTCLM/
cime/
components/
/src/fates/
/tools/PTCLM/
/cime/
/components/

# ignore svn directories
**/.svn/**
Expand All @@ -26,28 +26,35 @@ CMakeFiles/


# unit testing directories
src/unit_tests.*
/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

# don't ignore cism build utilities directory
!components/cism/**/build

# configure / build files
bld/**/CESM_cppdefs
bld/**/Filepath
bld/**/config_cache.xml
bld/**/lnd_in
bld/**/drv_flds_in
/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
/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
Expand All @@ -66,19 +73,19 @@ clm.input_data_list.previous
*.stdout.txt.o*

# Tools executables
tools/mksurfdata_map/mksurfdata_map
tools/mkprocdata_map/mkprocdata_map
/tools/mksurfdata_map/mksurfdata_map
/tools/mkprocdata_map/mkprocdata_map

# mksurfdata output files
tools/mksurfdata_map/surfdata_*.nc
tools/mksurfdata_map/landuse.timeseries_*.nc
/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
/tools/mkmapdata/PET*.RegridWeightGen.Log
/tools/mkmapdata/regrid.*.out
/tools/mkmapdata/regrid.*.err
/tools/mkmapdata/regrid.o*
/tools/mkmapdata/map*.nc

# build output
*.o
Expand Down
32 changes: 18 additions & 14 deletions bld/namelist_files/namelist_definition_clm4_5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2432,20 +2432,24 @@ 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 when transitioning from a spinup
run to a transient run, or in other 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.
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.)

</entry>

Expand Down
1 change: 0 additions & 1 deletion cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<category name="aux_clm">
<entry issue="#404" >FAIL ERP_D_Ld10_P36x2.f10_f10_musgs.IHistClm50BgcCrop.cheyenne_intel.clm-ciso_decStart RUN</entry>
<entry issue="#158" >FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_gnu.clm-monthly RUN</entry>
<entry issue="#158" >FAIL ERS_Lm20_Mmpi-serial.1x1_smallvilleIA.I2000Clm50BgcCropGs.cheyenne_intel.clm-monthly RUN</entry>
<entry issue="#384" >FAIL ERP_D_Ld5.f09_g17.I2000Clm50Vic.cheyenne_intel.clm-vrtlay RUN</entry>
<entry issue="#442" >FAIL SMS.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN</entry>
<entry issue="#442" >FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN</entry>
Expand Down
19 changes: 3 additions & 16 deletions cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,6 @@
<option name="tput_tolerance">0.5</option>
</options>
</test>
<test name="ERP_P36x2_Lm36" grid="f10_f10_musgs" compset="I2000Clm50BgcCrop" testmods="clm/irrigOn_reduceOutput">
<machines>
<machine name="cheyenne" compiler="intel" category="prebeta"/>
</machines>
<options>
<option name="wallclock">00:60:00</option>
</options>
</test>
<test name="ERP_P180x2_D" grid="f19_g17" compset="I2000Clm50SpRtmFl" testmods="clm/default">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
Expand Down Expand Up @@ -753,6 +745,7 @@
<test name="ERP_P72x2_Lm36" grid="f10_f10_musgs" compset="I2000Clm50BgcCrop" testmods="clm/clm50cropIrrigMonth_interp">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="prebeta"/>
</machines>
<options>
<option name="wallclock">01:40:00</option>
Expand Down Expand Up @@ -945,7 +938,6 @@
</test>
<test name="ERS_Lm20_Mmpi-serial" grid="1x1_smallvilleIA" compset="I2000Clm50BgcCropGs" testmods="clm/monthly">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
</machines>
<options>
Expand All @@ -955,7 +947,6 @@
</test>
<test name="ERS_Lm40_Mmpi-serial" grid="1x1_numaIA" compset="I2000Clm50BgcCropGs" testmods="clm/monthly">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
</machines>
<options>
Expand All @@ -966,7 +957,6 @@
<test name="ERS_Lm54_Mmpi-serial" grid="1x1_numaIA" compset="I2000Clm50BgcCropGs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">01:20:00</option>
Expand All @@ -976,7 +966,6 @@
<test name="ERS_Ly20_Mmpi-serial" grid="1x1_numaIA" compset="I2000Clm50BgcDvCropQianGs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">01:40:00</option>
Expand All @@ -1003,7 +992,6 @@
<test name="ERS_Ly3_Mmpi-serial" grid="1x1_smallvilleIA" compset="IHistClm50BgcCropGs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">01:40:00</option>
Expand Down Expand Up @@ -1047,7 +1035,6 @@
</test>
<test name="ERS_Ly6_Mmpi-serial" grid="1x1_smallvilleIA" compset="IHistClm50BgcCropGs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
Expand Down Expand Up @@ -1350,10 +1337,10 @@
</test>
<test name="SMS_D_Ly6_Mmpi-serial" grid="1x1_smallvilleIA" compset="IHistClm45BgcCropQianGs" testmods="clm/cropMonthOutput">
<machines>
<machine name="cheyenne" compiler="gnu" category="aux_clm"/>
<machine name="cheyenne" compiler="intel" category="aux_clm"/>
</machines>
<options>
<option name="wallclock">01:40:00</option>
<option name="wallclock">02:00:00</option>
<option name="comment" >Want a debug test that tests a number of aspects of transient crops, including a new crop landunit and shifting PCT_CFT; move to CLM50 once we can get it fast enough (see bug 2391)</option>
</options>
</test>
Expand Down
1 change: 1 addition & 0 deletions cime_config/usermods_dirs/cmip6_output/user_nl_cpl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
histaux_l2x1yrg = .true.
136 changes: 136 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,140 @@
===============================================================
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.dev005
Originator(s): sacks (Bill Sacks), mvr (Mathew Rothstein)
Date: Fri Aug 3 07:54:59 MDT 2018
Expand Down
1 change: 1 addition & 0 deletions doc/ChangeSum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Tag Who Date Summary
============================================================================================================================
ctsm1.0.dev006 sacks 08/04/2018 Minor bug fixes, cleanup, documentation and enhancements
ctsm1.0.dev005 sacks 08/03/2018 Rework water data types to accommodate isotopes and other tracers
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
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNDriverMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ subroutine CNDriverNoLeaching(bounds,
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), &
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), &
Expand Down
2 changes: 1 addition & 1 deletion src/biogeochem/CNFUNMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ subroutine CNFUN(bounds,num_soilc, filter_soilc,num_soilp&
frac_ideal_C_use = max(0.0_r8,1.0_r8 - (total_N_resistance-fun_cn_flex_a(ivt(p)))/fun_cn_flex_b(ivt(p)) )
! then, if the plant is very much in need of N, the C used for uptake is increased accordingly.
if(delta_CN .gt.0.and. frac_ideal_C_use.lt.1.0)then
frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p)));
frac_ideal_C_use = frac_ideal_C_use + (1.0_r8-frac_ideal_C_use)*min(1.0_r8, delta_CN/fun_cn_flex_c(ivt(p)))
end if
! If we have too much N (e.g. from free N retranslocation) then make frac_ideal_c_use even lower.
! For a CN delta of fun_cn_flex_c, then we reduce C expendiure to the minimum of 0.5.
Expand Down
Loading

0 comments on commit 8ad23e5

Please sign in to comment.