Skip to content

Commit

Permalink
Merge branch 'master' into groundwater_irrigation
Browse files Browse the repository at this point in the history
  • Loading branch information
billsacks committed Nov 30, 2018
2 parents a2d0e53 + 9445576 commit 6fd47d7
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 41 deletions.
1 change: 1 addition & 0 deletions cime_config/testdefs/ExpectedTestFails.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<entry issue="#442" >FAIL SMS_D.f10_f10_musgs.I2000Clm50BgcCrop.hobart_pgi.clm-crop RUN</entry>
<entry issue="#550" >FAIL ERS_D_Ln9_P480x3.f19_g16.I2000Clm50SpGs.cheyenne_intel.clm-waccmx_offline COMPARE_base_rest</entry>
<entry issue="ESMCI/cime#2917" >FAIL PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel GENERATE</entry>
<entry issue="ESMCI/cime#2917" >FAIL PFS_Ld20.f09_g17.I2000Clm50BgcCrop.cheyenne_intel BASELINE</entry>
</category>
<category name="fates">
<entry issue="NGEET/fates#315">FAIL ERS_Ld60.f45_f45_mg37.I2000Clm45Fates.hobart_nag.clm-Fates COMPARE_base_rest</entry>
Expand Down
137 changes: 137 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,141 @@
===============================================================
Tag name: ctsm1.0.dev019
Originator(s): sacks (Bill Sacks)
Date: Fri Nov 30 13:36:57 MST 2018
One-line Summary: Rework cold start initialization of wa and zwt

Purpose of changes
------------------

Rework cold start initialization of wa and zwt when use_aquifer_layer is
false to reduce answer changes in upcoming groundwater_irrigation
branch.

In the groundwater_irrigation branch
(https://github.com/ESCOMP/ctsm/pull/523), Sean Swenson has stopped
resetting wa_col each time step if use_aquifer_layer is false. However,
this leads to having a substantially different value of wa_col when
use_aquifer_layer is false: previously, it was reset to
aquifer_water_baseline each time step, but with Sean's changes, it stays
close to its initial values, which have been 4000 in most places. This
tag changes the initial values to match the value it was being reset to,
so it simply starts at aquifer_water_baseline - so the
every-time-step-resetting to aquifer_water_baseline can be removed
without massively changing the value of wa_col.

In addition to changing the cold start initialization of wa_col, we are
also changing the cold start initialization of zwt in this case where
use_aquifer_layer is false: The old initialization of zwt wouldn't work
as intended now that we have changed the initial value of wa_col; Sean
Swenson suggested this new initialization method instead. This
initialization to zi(c,nbedrock(c)) is correct if there are no saturated
layers, and close enough for a decent cold start even if there are.


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 ../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: Sean Swenson


CTSM testing:

[PASS means all tests PASS and OK means tests PASS other than expected fails.]

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 ---- ok
hobart ------ ok

ok means tests pass, answers change as expected for some cases

CTSM tag used for the baseline comparisons: ctsm1.0.dev018


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 cold start or transient (Hist) cases
- what platforms/compilers: all
- nature of change (roundoff; larger than roundoff/same climate; new climate):

Larger than roundoff, same climate (not investigated completely
rigorously through long simulations, but Sean Swenson and Bill
Sacks are both pretty confident that the resulting changes will be
small, partly based on difference statistics from the test suite,
and partly based on the fact that the only change in this tag is
in cold start initialization of some values).

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/577

===============================================================
===============================================================
Tag name: ctsm1.0.dev018
Originator(s): sacks (Bill Sacks)
Date: Thu Nov 29 16:03:50 MST 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.dev019 sacks 11/30/2018 Rework cold start initialization of wa and zwt
ctsm1.0.dev018 sacks 11/29/2018 Water tracer updates for initial things in driver loop
ctsm1.0.dev017 slevis 11/28/2018 Merge the collapse2gencrop branch
ctsm1.0.dev016 sacks 11/01/2018 Update cime, fix FATES DEBUG token, add script to easily run system tests
Expand Down
41 changes: 34 additions & 7 deletions src/biogeophys/SoilHydrologyInitTimeConstMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ module SoilHydrologyInitTimeConstMod
contains

!-----------------------------------------------------------------------
subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, waterstatebulk_inst)
subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, waterstatebulk_inst, &
use_aquifer_layer)
!
! !USES:
use shr_const_mod , only : shr_const_pi
Expand All @@ -53,6 +54,7 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, waterstatebulk
type(bounds_type) , intent(in) :: bounds
type(soilhydrology_type) , intent(inout) :: soilhydrology_inst
type(waterstatebulk_type) , intent(inout) :: waterstatebulk_inst
logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run
!
! !LOCAL VARIABLES:
integer :: p,c,j,l,g,lev,nlevs
Expand Down Expand Up @@ -91,19 +93,44 @@ subroutine SoilHydrologyInitTimeConst(bounds, soilhydrology_inst, waterstatebulk
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 line)
! seem implicitly related to aquifer_water_baseline
soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - waterstatebulk_inst%wa_col(c)/0.2_r8 /1000._r8 ! One meter below soil column
if (use_aquifer_layer) then
! NOTE(wjs, 2018-11-27) There is no fundamental reason why zwt should
! be initialized differently based on use_aquifer_layer, but we (Bill
! Sacks and Sean Swenson) are changing the cold start initialization of
! wa_col when use_aquifer_layer is .false., and so need to come up with
! a different cold start initialization of zwt in that case, but we
! don't want to risk messing up the use_aquifer_layer = .true. case,
! so we're keeping that as it was before.

! Note that the following hard-coded constants (on the next line)
! seem implicitly related to the initial value of wa_col
soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - waterstatebulk_inst%wa_col(c)/0.2_r8 /1000._r8 ! One meter below soil column
else
soilhydrology_inst%zwt_col(c) = col%zi(c,col%nbedrock(c))
end if
else
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 line) seem
! implicitly related to aquifer_water_baseline
soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - waterstatebulk_inst%wa_col(c)/0.2_r8 /1000._r8 ! One meter below soil column
if (use_aquifer_layer) then
! NOTE(wjs, 2018-11-27) There is no fundamental reason why zwt should
! be initialized differently based on use_aquifer_layer, but we (Bill
! Sacks and Sean Swenson) are changing the cold start initialization of
! wa_col when use_aquifer_layer is .false., and so need to come up with
! a different cold start initialization of zwt in that case, but we
! don't want to risk messing up the use_aquifer_layer = .true. case,
! so we're keeping that as it was before.

! Note that the following hard-coded constants (on the next line) seem
! implicitly related to the initial value of wa_col
soilhydrology_inst%zwt_col(c) = (25._r8 + col%zi(c,nlevsoi)) - waterstatebulk_inst%wa_col(c)/0.2_r8 /1000._r8
else
soilhydrology_inst%zwt_col(c) = col%zi(c,col%nbedrock(c))
end if

! 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)
Expand Down
12 changes: 9 additions & 3 deletions src/biogeophys/WaterStateBulkType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module WaterStateBulkType

!------------------------------------------------------------------------
subroutine InitBulk(this, bounds, info, vars, &
h2osno_input_col, watsat_col, t_soisno_col)
h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer)

class(waterstatebulk_type), intent(inout) :: this
type(bounds_type) , intent(in) :: bounds
Expand All @@ -59,10 +59,16 @@ subroutine InitBulk(this, bounds, info, vars, &
real(r8) , intent(in) :: h2osno_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)
logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run


call this%Init(bounds, info, vars, &
h2osno_input_col, watsat_col, t_soisno_col)
call this%Init(bounds = bounds, &
info = info, &
tracer_vars = vars, &
h2osno_input_col = h2osno_input_col, &
watsat_col = watsat_col, &
t_soisno_col = t_soisno_col, &
use_aquifer_layer = use_aquifer_layer)

call this%InitBulkAllocate(bounds)

Expand Down
53 changes: 33 additions & 20 deletions src/biogeophys/WaterStateType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ module WaterStateType

!------------------------------------------------------------------------
subroutine Init(this, bounds, info, tracer_vars, &
h2osno_input_col, watsat_col, t_soisno_col)
h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer)

class(waterstate_type), intent(inout) :: this
type(bounds_type) , intent(in) :: bounds
Expand All @@ -70,15 +70,19 @@ subroutine Init(this, bounds, info, tracer_vars, &
real(r8) , intent(in) :: h2osno_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)
logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run

this%info => info

call this%InitAllocate(bounds, tracer_vars)

call this%InitHistory(bounds)

call this%InitCold(bounds, &
h2osno_input_col, watsat_col, t_soisno_col)
call this%InitCold(bounds = bounds, &
h2osno_input_col = h2osno_input_col, &
watsat_col = watsat_col, &
t_soisno_col = t_soisno_col, &
use_aquifer_layer = use_aquifer_layer)

end subroutine Init

Expand Down Expand Up @@ -280,7 +284,7 @@ end subroutine InitHistory

!-----------------------------------------------------------------------
subroutine InitCold(this, bounds, &
h2osno_input_col, watsat_col, t_soisno_col)
h2osno_input_col, watsat_col, t_soisno_col, use_aquifer_layer)
!
! !DESCRIPTION:
! Initialize time constant variables and cold start conditions
Expand All @@ -299,6 +303,7 @@ subroutine InitCold(this, bounds, &
real(r8) , intent(in) :: h2osno_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)
logical , intent(in) :: use_aquifer_layer ! whether an aquifer layer is used in this run
!
! !LOCAL VARIABLES:
integer :: p,c,j,l,g,lev,nlevs
Expand Down Expand Up @@ -460,25 +465,33 @@ subroutine InitCold(this, bounds, &
end do


this%wa_col(bounds%begc:bounds%endc) = aquifer_water_baseline
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 constant (on the next line)
! seems implicitly related to aquifer_water_baseline
this%wa_col(c) = 4800._r8
this%wa_col(bounds%begc:bounds%endc) = aquifer_water_baseline
if (use_aquifer_layer) then
! NOTE(wjs, 2018-11-27) There is no fundamental reason why wa_col should be
! initialized differently based on use_aquifer_layer, but we (Bill Sacks and Sean
! Swenson) want to change the cold start initialization of wa_col to be
! aquifer_water_baseline everywhere for use_aquifer_layer .false., and we aren't
! sure of the implications of this change for use_aquifer_layer .true., so are
! maintaining the old cold start initialization in the latter case.
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 constant (on the next line)
! seems implicitly related to aquifer_water_baseline
this%wa_col(c) = 4800._r8
else
this%wa_col(c) = spval
end if
else
this%wa_col(c) = spval
! Note that the following hard-coded constant (on the next line) seems
! implicitly related to aquifer_water_baseline
this%wa_col(c) = 4000._r8
end if
else
! Note that the following hard-coded constant (on the next line) seems
! implicitly related to aquifer_water_baseline
this%wa_col(c) = 4000._r8
end if
end if
end do
end do
end if

end associate

Expand Down
Loading

0 comments on commit 6fd47d7

Please sign in to comment.