Skip to content

Commit 488860d

Browse files
committed
Merge remote-tracking branch 'slevisconsulting/gcell_bal_checks_ch4'
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
2 parents a3e738c + bed6890 commit 488860d

File tree

8 files changed

+263
-55
lines changed

8 files changed

+263
-55
lines changed

doc/ChangeLog

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,120 @@
11
===============================================================
2+
Tag name: ctsm1.0.dev103
3+
Originator(s): slevis (Samuel Levis, SLevis Consulting LLC,303-665-1310)
4+
Date: Mon Jun 29 17:16:29 MDT 2020
5+
One-line Summary: Gridcell-level balance-check for methane (CH4)
6+
7+
Purpose of changes
8+
------------------
9+
10+
Bracket the model time-step loop to calculate balance checks at the
11+
gridcell level, as detailed in issue #315. The column-level check
12+
remains unchanged.
13+
14+
Subroutine ch4_init_balance_check is replaced with
15+
ch4_init_column_balance_check. Subroutine
16+
ch4_init_gridcell_balance_check is added.
17+
18+
The implementation is similar to the one for carbon and nitrogen (see
19+
tag ctsm1.0.dev096).
20+
21+
Bugs fixed or introduced
22+
------------------------
23+
24+
Issues fixed (include CTSM Issue #): #315
25+
26+
27+
Significant changes to scientifically-supported configurations
28+
--------------------------------------------------------------
29+
30+
Does this tag change answers significantly for any of the following physics configurations?
31+
(Details of any changes will be given in the "Answer changes" section below.)
32+
33+
[Put an [X] in the box for any configuration with significant answer changes.]
34+
35+
[ ] clm5_0
36+
37+
[ ] ctsm5_0-nwp
38+
39+
[ ] clm4_5
40+
41+
Notes of particular relevance for users
42+
---------------------------------------
43+
44+
Caveats for users (e.g., need to interpolate initial conditions):
45+
None
46+
47+
Changes to CTSM's user interface (e.g., new/renamed XML or namelist variables):
48+
None
49+
50+
Changes made to namelist defaults (e.g., changed parameter values):
51+
None
52+
53+
Changes to the datasets (e.g., parameter, surface or initial files):
54+
None
55+
56+
Substantial timing or memory changes:
57+
No
58+
59+
Notes of particular relevance for developers: (including Code reviews and testing)
60+
---------------------------------------------
61+
NOTE: Be sure to review the steps in README.CHECKLIST.master_tags as well as the coding style in the Developers Guide
62+
63+
Caveats for developers (e.g., code that is duplicated that requires double maintenance):
64+
None
65+
66+
Changes to tests or testing:
67+
None
68+
69+
Code reviewed by:
70+
@billsacks
71+
72+
73+
CTSM testing:
74+
75+
[PASS means all tests PASS and OK means tests PASS other than expected fails.]
76+
77+
build-namelist tests:
78+
79+
cheyenne -
80+
81+
tools-tests (test/tools):
82+
83+
cheyenne -
84+
85+
PTCLM testing (tools/shared/PTCLM/test):
86+
87+
cheyenne -
88+
89+
python testing (see instructions in python/README.md; document testing done):
90+
91+
(any machine) -
92+
93+
regular tests (aux_clm):
94+
95+
cheyenne ---- PASS
96+
izumi ------- PASS
97+
98+
If the tag used for baseline comparisons was NOT the previous tag, note that here:
99+
100+
101+
Answer changes
102+
--------------
103+
104+
Changes answers relative to baseline:
105+
No
106+
107+
Detailed list of changes
108+
------------------------
109+
110+
List any externals directories updated (cime, rtm, mosart, cism, fates, etc.):
111+
None
112+
113+
Pull Requests that document the changes (include PR ids):
114+
https://github.com/ESCOMP/CTSM/pull/1022
115+
116+
===============================================================
117+
===============================================================
2118
Tag name: ctsm1.0.dev102
3119
Originator(s): erik (Erik Kluzek,UCAR/TSS,303-497-1326)
4120
Date: Fri Jun 26 01:32:04 MDT 2020

doc/ChangeSum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
Tag Who Date Summary
22
============================================================================================================================
3+
ctsm1.0.dev103 slevis 06/29/2020 Gridcell-level error-check for methane (CH4)
34
ctsm1.0.dev102 erik/ole 06/26/2020 Some important fixes for LUNA in clm5_0, and small urban issue in clm5_0
45
ctsm1.0.dev101 ole/erik 06/17/2020 Changes from Keith to bring a list of variables to the parameter file
56
ctsm1.0.dev100 sacks 06/09/2020 Deallocate memory after running init_interp

src/biogeochem/ch4Mod.F90

Lines changed: 132 additions & 38 deletions
Large diffs are not rendered by default.

src/cpl/mct/lnd_import_export.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ subroutine lnd_export( bounds, waterlnd2atmbulk_inst, lnd2atm_inst, lnd2glc_inst
378378
end if
379379

380380
if (index_l2x_Fall_methane /= 0) then
381-
l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%flux_ch4_grc(g)
381+
l2x(index_l2x_Fall_methane,i) = -lnd2atm_inst%ch4_surf_flux_tot_grc(g)
382382
endif
383383

384384
! sign convention is positive downward with

src/cpl/nuopc/lnd_import_export.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ subroutine export_fields( gcomp, bounds, glc_present, rof_prognostic, &
859859
minus=.true., ungridded_index=4, rc=rc)
860860
if (ChkErr(rc,__LINE__,u_FILE_u)) return
861861

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

865865
call state_setexport(exportState, 'Sl_ram1', bounds, input=lnd2atm_inst%ram1_grc, rc=rc)

src/main/clm_driver.F90

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module clm_driver
5858
use SoilBiogeochemVerticalProfileMod , only : SoilBiogeochemVerticalProfile
5959
use SatellitePhenologyMod , only : SatellitePhenology, interpMonthlyVeg
6060
use ndepStreamMod , only : ndep_interp
61-
use ch4Mod , only : ch4, ch4_init_balance_check
61+
use ch4Mod , only : ch4, ch4_init_gridcell_balance_check, ch4_init_column_balance_check
6262
use DUSTMod , only : DustDryDep, DustEmission
6363
use VOCEmissionMod , only : VOCEmission
6464
!
@@ -318,6 +318,12 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
318318
c14_soilbiogeochem_carbonstate_inst, &
319319
soilbiogeochem_nitrogenstate_inst)
320320
end if
321+
if (use_lch4) then
322+
call ch4_init_gridcell_balance_check(bounds_clump, &
323+
filter(nc)%num_nolakec, filter(nc)%nolakec, &
324+
filter(nc)%num_lakec, filter(nc)%lakec, &
325+
ch4_inst)
326+
end if
321327
call t_stopf('begcnbal_grc')
322328

323329
end do
@@ -397,7 +403,7 @@ subroutine clm_drv(doalb, nextsw_cday, declinp1, declin, rstwr, nlend, rdate, ro
397403
end if
398404

399405
if (use_lch4) then
400-
call ch4_init_balance_check(bounds_clump, &
406+
call ch4_init_column_balance_check(bounds_clump, &
401407
filter(nc)%num_nolakec, filter(nc)%nolakec, &
402408
filter(nc)%num_lakec, filter(nc)%lakec, &
403409
ch4_inst)

src/main/lnd2atmMod.F90

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,6 @@ subroutine lnd2atm(bounds, &
328328
lnd2atm_inst%flxdst_grc (bounds%begg:bounds%endg, :), &
329329
p2c_scale_type='unity', c2l_scale_type= 'unity', l2g_scale_type='unity')
330330

331-
332-
! ch4 flux
333-
if (use_lch4) then
334-
call c2g( bounds, &
335-
ch4_inst%ch4_surf_flux_tot_col (bounds%begc:bounds%endc), &
336-
lnd2atm_inst%flux_ch4_grc (bounds%begg:bounds%endg), &
337-
c2l_scale_type= 'unity', l2g_scale_type='unity' )
338-
end if
339-
340331
!----------------------------------------------------
341332
! lnd -> rof
342333
!----------------------------------------------------

src/main/lnd2atmType.F90

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module lnd2atmType
5656
real(r8), pointer :: flxvoc_grc (:,:) => null() ! VOC flux (size bins)
5757
real(r8), pointer :: fireflx_grc (:,:) => null() ! Wild Fire Emissions
5858
real(r8), pointer :: fireztop_grc (:) => null() ! Wild Fire Emissions vertical distribution top
59-
real(r8), pointer :: flux_ch4_grc (:) => null() ! net CH4 flux (kg C/m**2/s) [+ to atm]
59+
real(r8), pointer :: ch4_surf_flux_tot_grc(:) => null() ! net CH4 flux (kg C/m**2/s) [+ to atm]
6060
! lnd->rof
6161

6262
contains
@@ -150,7 +150,7 @@ subroutine InitAllocate(this, bounds)
150150
allocate(this%ram1_grc (begg:endg)) ; this%ram1_grc (:) =ival
151151
allocate(this%fv_grc (begg:endg)) ; this%fv_grc (:) =ival
152152
allocate(this%flxdst_grc (begg:endg,1:ndst)) ; this%flxdst_grc (:,:) =ival
153-
allocate(this%flux_ch4_grc (begg:endg)) ; this%flux_ch4_grc (:) =ival
153+
allocate(this%ch4_surf_flux_tot_grc(begg:endg)) ; this%ch4_surf_flux_tot_grc(:) =ival
154154

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

271271
if (use_lch4) then
272-
this%flux_ch4_grc(begg:endg) = 0._r8
272+
this%ch4_surf_flux_tot_grc(begg:endg) = 0._r8
273273
call hist_addfld1d (fname='FCH4', units='kgC/m2/s', &
274274
avgflag='A', long_name='Gridcell surface CH4 flux to atmosphere (+ to atm)', &
275-
ptr_lnd=this%flux_ch4_grc)
275+
ptr_lnd=this%ch4_surf_flux_tot_grc)
276276

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

0 commit comments

Comments
 (0)