Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ELM v2 data architecture for mass and energy state and flux variables #2742

Merged
merged 44 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1346113
introduce column sub-types for state and flux variables
thorntonpe Nov 14, 2018
6d8e7ab
Introduce state and flux variable sub-types at veg level
thorntonpe Nov 14, 2018
d1a592b
Update column, vegetation, and landunit levels with new data types
thorntonpe Nov 15, 2018
eff6be9
Preliminary test for migrating one variable to col_es
thorntonpe Nov 21, 2018
ef783cc
Reorganize column data types to avoid circular references
thorntonpe Nov 25, 2018
1a7cdd5
Add a few more column-level temperature variables to new data type
thorntonpe Nov 25, 2018
9786cfc
Add soil and snow temperature variables to the column energy state type
thorntonpe Nov 26, 2018
1226f34
Add t_grnd, t_lake, and a few derived temperature variables to col_es
thorntonpe Nov 27, 2018
68cbb39
Add rural and urban ground temperature to new data structures
thorntonpe Dec 5, 2018
48b2da7
Complete migration of column energy state variables to v2 data types
thorntonpe Jan 15, 2019
d61434b
Add vegetation-level energy state structure and begin populating
thorntonpe Jan 16, 2019
9e585f1
Adds vegetation energy state data structure, ELM V2 data architecture
thorntonpe Jan 17, 2019
5447e9d
Added gridcell-level energy state variables to V2 data architecture
thorntonpe Jan 22, 2019
1900262
Add history file handling for topounit-level variables
thorntonpe Jan 23, 2019
f29a2e2
Update all references to atmospheric state and flux structures.
thorntonpe Jan 23, 2019
64b8148
Added history fields for atmospheric flux variables to v2 data structs
thorntonpe Jan 24, 2019
a1b0b0a
Add landunit-level temperature variables to v2 data architecture
thorntonpe Jan 24, 2019
1370b0e
Add column-level energy flux variables to v2 data architecture
thorntonpe Jan 25, 2019
a744c4f
Add a few additional energy variables to v2 data architecture
thorntonpe Jan 25, 2019
f508f5c
Migrate all veg-level energy flux variables to v2 data architecture
thorntonpe Jan 25, 2019
d065951
Add landunit and gridcell-level energy flux variables to v2 data types
thorntonpe Jan 25, 2019
70f4499
Add column water state component of v2 data architecture
thorntonpe Jan 29, 2019
ebfcbc0
Add remaining column water state variables to v2 data architecture
thorntonpe Jan 29, 2019
4f5b406
Add gridcell, landunit, and vegetation-level water state vars v2 data
thorntonpe Jan 29, 2019
2eb42ec
Add column-level water flux variables to v2 data architecture
thorntonpe Jan 30, 2019
855e728
Moves vegetation-level water flux variables into v2 data architecture
thorntonpe Jan 30, 2019
9e8410d
Add column-level carbon state structures to v2 data architecture
thorntonpe Feb 1, 2019
85c7d36
Add and initialize vegetation-level carbon state data structures
thorntonpe Feb 2, 2019
526e14c
Add additional vegetation-level carbon state variables to v2 data types
thorntonpe Feb 3, 2019
416bde3
Complete migration of carbon state variables to v2 data architecture
thorntonpe Feb 3, 2019
c16aa6b
Add vegetation-level carbon fluxes to v2 data architecture
thorntonpe Feb 4, 2019
0c63a0f
Adds the column-level carbon flux structures to v2 data architecture
thorntonpe Feb 4, 2019
fe0fb83
Completes the migration of carbon flux variables into v2 data types
thorntonpe Feb 5, 2019
d2235a9
Adds all column and vegetation-level N state variables to v2 data
thorntonpe Feb 10, 2019
f84b2fb
Add infrastructure for nitrogen flux variables in v2 data architecture
thorntonpe Feb 10, 2019
f2296df
Add all nitrogen flux variables to v2 data architecture
thorntonpe Feb 11, 2019
7297b6a
Add all phosphorus state variables to v2 data architecture
thorntonpe Feb 11, 2019
640b4e0
Adds infrastructure for phosphorus flux variables in v2 data structs
thorntonpe Feb 12, 2019
816ca41
Completes phosphorus flux data migration for v2 data architecture
thorntonpe Feb 12, 2019
b0d51bf
Example implementation of subroutine calling interface, v2 data
thorntonpe Feb 12, 2019
965430e
Resolve some merge conflicts resulting from rebase of branch on master
thorntonpe Feb 14, 2019
0c5a53e
Remove the CNDV dynamic biogeography code and data structures
thorntonpe Feb 15, 2019
9cea565
Minor fix for build error with dynSubgridAdjustmentsMod.F90
jqyin Mar 7, 2019
33ccf67
Initialize qflx_lateral to 0.0
jqyin Mar 11, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
741 changes: 373 additions & 368 deletions components/clm/src/biogeochem/AllocationMod.F90

Large diffs are not rendered by default.

19 changes: 7 additions & 12 deletions components/clm/src/biogeochem/AnnualUpdateMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ module AnnualUpdateMod
use decompMod , only : bounds_type
use CNCarbonFluxType , only : carbonflux_type
use CNStateType , only : cnstate_type
use ColumnDataType , only : col_cf
use VegetationDataType, only : veg_cf
!
implicit none
save
Expand All @@ -32,7 +34,6 @@ subroutine AnnualUpdate(bounds, &
use clm_time_manager, only: get_step_size, get_days_per_year
use clm_varcon , only: secspday
use SubgridAveMod , only: p2c
use clm_varctl , only: use_cndv
!
! !ARGUMENTS:
type(bounds_type) , intent(in) :: bounds
Expand Down Expand Up @@ -83,21 +84,15 @@ subroutine AnnualUpdate(bounds, &
cnstate_vars%tempavg_t2m_patch(p) = 0._r8

! update annual NPP accumulator, convert to annual total
carbonflux_vars%annsum_npp_patch(p) = carbonflux_vars%tempsum_npp_patch(p) * dt
carbonflux_vars%tempsum_npp_patch(p) = 0._r8

if (use_cndv) then
! update annual litfall accumulator, convert to annual total
carbonflux_vars%annsum_litfall_patch(p) = carbonflux_vars%tempsum_litfall_patch(p) * dt
carbonflux_vars%tempsum_litfall_patch(p) = 0._r8
end if
end do
veg_cf%annsum_npp(p) = veg_cf%tempsum_npp(p) * dt
veg_cf%tempsum_npp(p) = 0._r8

end do
! use p2c routine to get selected column-average pft-level fluxes and states

call p2c(bounds, num_soilc, filter_soilc, &
carbonflux_vars%annsum_npp_patch(bounds%begp:bounds%endp), &
carbonflux_vars%annsum_npp_col(bounds%begc:bounds%endc))
veg_cf%annsum_npp(bounds%begp:bounds%endp), &
col_cf%annsum_npp(bounds%begc:bounds%endc))

call p2c(bounds, num_soilc, filter_soilc, &
cnstate_vars%annavg_t2m_patch(bounds%begp:bounds%endp), &
Expand Down
52 changes: 27 additions & 25 deletions components/clm/src/biogeochem/C14DecayMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ module C14DecayMod
use CNCarbonStateType , only : carbonstate_type
use CNStateType , only : cnstate_type
use clm_varctl , only : nu_com
use ColumnDataType , only : c14_col_cs
use VegetationDataType , only : c14_veg_cs
!
implicit none
save
Expand Down Expand Up @@ -63,31 +65,31 @@ subroutine C14Decay( num_soilc, filter_soilc, num_soilp, filter_soilp, &
associate( &
spinup_factor => decomp_cascade_con%spinup_factor , & ! Input: [real(r8) (:) ] factor for AD spinup associated with each pool

decomp_cpools_vr => c14_carbonstate_vars%decomp_cpools_vr_col , & ! Output: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools
seedc => c14_carbonstate_vars%seedc_col , & ! Output: [real(r8) (:) ]
cpool => c14_carbonstate_vars%cpool_patch , & ! Output: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool
xsmrpool => c14_carbonstate_vars%xsmrpool_patch , & ! Output: [real(r8) (:) ] (gC/m2) execss maint resp C pool
deadcrootc => c14_carbonstate_vars%deadcrootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C
deadcrootc_storage => c14_carbonstate_vars%deadcrootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C storage
deadcrootc_xfer => c14_carbonstate_vars%deadcrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer
deadstemc => c14_carbonstate_vars%deadstemc_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C
deadstemc_storage => c14_carbonstate_vars%deadstemc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C storage
deadstemc_xfer => c14_carbonstate_vars%deadstemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C transfer
frootc => c14_carbonstate_vars%frootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C
frootc_storage => c14_carbonstate_vars%frootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C storage
frootc_xfer => c14_carbonstate_vars%frootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) fine root C transfer
gresp_storage => c14_carbonstate_vars%gresp_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration storage
gresp_xfer => c14_carbonstate_vars%gresp_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration transfer
leafc => c14_carbonstate_vars%leafc_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C
leafc_storage => c14_carbonstate_vars%leafc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C storage
leafc_xfer => c14_carbonstate_vars%leafc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer
livecrootc => c14_carbonstate_vars%livecrootc_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C
livecrootc_storage => c14_carbonstate_vars%livecrootc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C storage
livecrootc_xfer => c14_carbonstate_vars%livecrootc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer
livestemc => c14_carbonstate_vars%livestemc_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C
livestemc_storage => c14_carbonstate_vars%livestemc_storage_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C storage
livestemc_xfer => c14_carbonstate_vars%livestemc_xfer_patch , & ! Output: [real(r8) (:) ] (gC/m2) live stem C transfer
pft_ctrunc => c14_carbonstate_vars%ctrunc_patch & ! Output: [real(r8) (:) ] (gC/m2) pft-level sink for C truncation
decomp_cpools_vr => c14_col_cs%decomp_cpools_vr , & ! Output: [real(r8) (:,:,:) ] (gC/m3) vertically-resolved decomposing (litter, cwd, soil) c pools
seedc => c14_col_cs%seedc , & ! Output: [real(r8) (:) ]
cpool => c14_veg_cs%cpool , & ! Output: [real(r8) (:) ] (gC/m2) temporary photosynthate C pool
xsmrpool => c14_veg_cs%xsmrpool , & ! Output: [real(r8) (:) ] (gC/m2) execss maint resp C pool
deadcrootc => c14_veg_cs%deadcrootc , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C
deadcrootc_storage => c14_veg_cs%deadcrootc_storage , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C storage
deadcrootc_xfer => c14_veg_cs%deadcrootc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) dead coarse root C transfer
deadstemc => c14_veg_cs%deadstemc , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C
deadstemc_storage => c14_veg_cs%deadstemc_storage , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C storage
deadstemc_xfer => c14_veg_cs%deadstemc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) dead stem C transfer
frootc => c14_veg_cs%frootc , & ! Output: [real(r8) (:) ] (gC/m2) fine root C
frootc_storage => c14_veg_cs%frootc_storage , & ! Output: [real(r8) (:) ] (gC/m2) fine root C storage
frootc_xfer => c14_veg_cs%frootc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) fine root C transfer
gresp_storage => c14_veg_cs%gresp_storage , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration storage
gresp_xfer => c14_veg_cs%gresp_xfer , & ! Output: [real(r8) (:) ] (gC/m2) growth respiration transfer
leafc => c14_veg_cs%leafc , & ! Output: [real(r8) (:) ] (gC/m2) leaf C
leafc_storage => c14_veg_cs%leafc_storage , & ! Output: [real(r8) (:) ] (gC/m2) leaf C storage
leafc_xfer => c14_veg_cs%leafc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) leaf C transfer
livecrootc => c14_veg_cs%livecrootc , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C
livecrootc_storage => c14_veg_cs%livecrootc_storage , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C storage
livecrootc_xfer => c14_veg_cs%livecrootc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) live coarse root C transfer
livestemc => c14_veg_cs%livestemc , & ! Output: [real(r8) (:) ] (gC/m2) live stem C
livestemc_storage => c14_veg_cs%livestemc_storage , & ! Output: [real(r8) (:) ] (gC/m2) live stem C storage
livestemc_xfer => c14_veg_cs%livestemc_xfer , & ! Output: [real(r8) (:) ] (gC/m2) live stem C transfer
pft_ctrunc => c14_veg_cs%ctrunc & ! Output: [real(r8) (:) ] (gC/m2) pft-level sink for C truncation
)

! set time steps
Expand Down
Loading