Skip to content

Commit

Permalink
Merge remote-tracking branch 'slevisconsulting/gcell_bal_checks_ch4'
Browse files Browse the repository at this point in the history
Gridcell-level balance-check for methane (CH4)

Bracket the model time-step loop to calculate balance checks at the
gridcell level, as detailed in issue #315. The column-level check
remains unchanged.

Subroutine ch4_init_balance_check is replaced with
ch4_init_column_balance_check. Subroutine
ch4_init_gridcell_balance_check is added.

The implementation is similar to the one for carbon and nitrogen (see
tag ctsm1.0.dev096).

Resolves #315
  • Loading branch information
billsacks committed Jun 30, 2020
2 parents a3e738c + bed6890 commit 488860d
Show file tree
Hide file tree
Showing 8 changed files with 263 additions and 55 deletions.
116 changes: 116 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,4 +1,120 @@
===============================================================
Tag name: ctsm1.0.dev103
Originator(s): slevis (Samuel Levis, SLevis Consulting LLC,303-665-1310)
Date: Mon Jun 29 17:16:29 MDT 2020
One-line Summary: Gridcell-level balance-check for methane (CH4)

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

Bracket the model time-step loop to calculate balance checks at the
gridcell level, as detailed in issue #315. The column-level check
remains unchanged.

Subroutine ch4_init_balance_check is replaced with
ch4_init_column_balance_check. Subroutine
ch4_init_gridcell_balance_check is added.

The implementation is similar to the one for carbon and nitrogen (see
tag ctsm1.0.dev096).

Bugs fixed or introduced
------------------------

Issues fixed (include CTSM Issue #): #315


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

[ ] ctsm5_0-nwp

[ ] 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):
None

Changes to the datasets (e.g., parameter, surface or initial files):
None

Substantial timing or memory changes:
No

Notes of particular relevance for developers: (including Code reviews and testing)
---------------------------------------------
NOTE: Be sure to review the steps in README.CHECKLIST.master_tags 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:
@billsacks


CTSM testing:

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

build-namelist tests:

cheyenne -

tools-tests (test/tools):

cheyenne -

PTCLM testing (tools/shared/PTCLM/test):

cheyenne -

python testing (see instructions in python/README.md; document testing done):

(any machine) -

regular tests (aux_clm):

cheyenne ---- PASS
izumi ------- PASS

If the tag used for baseline comparisons was NOT the previous tag, note that here:


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

===============================================================
===============================================================
Tag name: ctsm1.0.dev102
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
Date: Fri Jun 26 01:32:04 MDT 2020
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.dev103 slevis 06/29/2020 Gridcell-level error-check for methane (CH4)
ctsm1.0.dev102 erik/ole 06/26/2020 Some important fixes for LUNA in clm5_0, and small urban issue in clm5_0
ctsm1.0.dev101 ole/erik 06/17/2020 Changes from Keith to bring a list of variables to the parameter file
ctsm1.0.dev100 sacks 06/09/2020 Deallocate memory after running init_interp
Expand Down
170 changes: 132 additions & 38 deletions src/biogeochem/ch4Mod.F90

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/cpl/mct/lnd_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst
end if

if (index_l2x_Fall_methane /= 0) then
l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%flux_ch4_grc(g)
l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%ch4_surf_flux_tot_grc(g)
endif

! sign convention is positive downward with
Expand Down
2 changes: 1 addition & 1 deletion src/cpl/nuopc/lnd_import_export.F90
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ subroutine export_fields( gcomp, bounds, glc_present, rof_prognostic, &
minus=.true., ungridded_index=4, rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call state_setexport(exportState, 'Fall_methane', bounds, input=lnd2atm_inst%flux_ch4_grc, minus=.true., rc=rc)
call state_setexport(exportState, 'Fall_methane', bounds, input=lnd2atm_inst%ch4_surf_flux_tot_grc, minus=.true., rc=rc)
if (ChkErr(rc,__LINE__,u_FILE_u)) return

call state_setexport(exportState, 'Sl_ram1', bounds, input=lnd2atm_inst%ram1_grc, rc=rc)
Expand Down
10 changes: 8 additions & 2 deletions src/main/clm_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module clm_driver
use SoilBiogeochemVerticalProfileMod , only : SoilBiogeochemVerticalProfile
use SatellitePhenologyMod , only : SatellitePhenology, interpMonthlyVeg
use ndepStreamMod , only : ndep_interp
use ch4Mod , only : ch4, ch4_init_balance_check
use ch4Mod , only : ch4, ch4_init_gridcell_balance_check, ch4_init_column_balance_check
use DUSTMod , only : DustDryDep, DustEmission
use VOCEmissionMod , only : VOCEmission
!
Expand Down Expand Up @@ -318,6 +318,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
c14_soilbiogeochem_carbonstate_inst, &
soilbiogeochem_nitrogenstate_inst)
end if
if (use_lch4) then
call ch4_init_gridcell_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_grc')

end do
Expand Down Expand Up @@ -397,7 +403,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
end if

if (use_lch4) then
call ch4_init_balance_check(bounds_clump, &
call ch4_init_column_balance_check(bounds_clump, &
filter(nc)%num_nolakec, filter(nc)%nolakec, &
filter(nc)%num_lakec, filter(nc)%lakec, &
ch4_inst)
Expand Down
9 changes: 0 additions & 9 deletions src/main/lnd2atmMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,6 @@ subroutine lnd2atm(bounds, &
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
!----------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions src/main/lnd2atmType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module lnd2atmType
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]
real(r8), pointer :: ch4_surf_flux_tot_grc(:) => null() ! net CH4 flux (kg C/m**2/s) [+ to atm]
! lnd->rof

contains
Expand Down Expand Up @@ -150,7 +150,7 @@ subroutine InitAllocate(this, bounds)
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%ch4_surf_flux_tot_grc(begg:endg)) ; this%ch4_surf_flux_tot_grc(:) =ival

if (shr_megan_mechcomps_n>0) then
allocate(this%flxvoc_grc(begg:endg,1:shr_megan_mechcomps_n)); this%flxvoc_grc(:,:)=ival
Expand Down Expand Up @@ -269,10 +269,10 @@ subroutine InitHistory(this, bounds)
default='inactive')

if (use_lch4) then
this%flux_ch4_grc(begg:endg) = 0._r8
this%ch4_surf_flux_tot_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)
ptr_lnd=this%ch4_surf_flux_tot_grc)

this%nem_grc(begg:endg) = spval
call hist_addfld1d (fname='NEM', units='gC/m2/s', &
Expand Down

0 comments on commit 488860d

Please sign in to comment.