Skip to content

Commit 0d6156c

Browse files
committed
adding temporary diagnostics
1 parent 96371d0 commit 0d6156c

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

biogeochem/FatesSoilBGCFluxMod.F90

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,8 @@ subroutine FluxIntoLitterPools(csite)
673673
currentPatch => csite%oldest_patch
674674
flux_patch_loop: do while (associated(currentPatch))
675675

676+
write(*,*) 'Entering FluxIntoLitterPools for patch ', currentPatch%patchno
677+
676678
associate( &
677679
bc_out => csite%bc_out(currentPatch%patchno), &
678680
bc_in => csite%bc_in(currentPatch%patchno) &
@@ -835,6 +837,12 @@ subroutine FluxIntoLitterPools(csite)
835837
flux_all_si = sum(flux_cel_si(:) * bc_in%dz_decomp_sisl(:)) + &
836838
sum(flux_lig_si(:) * bc_in%dz_decomp_sisl(:)) + &
837839
sum(flux_lab_si(:) * bc_in%dz_decomp_sisl(:))
840+
! if (flux_all_si > 1e35_r8) then
841+
write(fates_log(), *) 'flux_all: ', flux_all_si
842+
write(fates_log(), *) 'sum cel, lig, lab: ', sum(flux_cel_si), sum(flux_lig_si), sum(flux_lab_si)
843+
write(fates_log(), *) 'sum dz: ', sum(bc_in%dz_decomp_sisl(:))
844+
! call endrun(msg=errMsg(__FILE__, __LINE__))
845+
! end if
838846

839847
end do flux_elem_loop
840848

main/FatesInterfaceTypesMod.F90

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ subroutine CheckInterfaceVariables(this)
11151115
! Check that the rank matches
11161116
if (this%hlm_vars(i)%data_rank /= this%fates_vars(i)%data_rank) then
11171117
write(*,*) "Rank mismatch for variable: ", this%key(i)
1118+
write(*,*) "Rank: hlm, fates: ", this%hlm_vars(i)%data_rank, this%fates_vars(i)%data_rank
11181119
call endrun(msg=errMsg(__FILE__, __LINE__))
11191120
end if
11201121

@@ -1689,20 +1690,43 @@ subroutine UpdateLitterFluxes(this, dtime)
16891690
j = this%filter_litter_flux(i)
16901691

16911692
! Update the hlm variables with the fates variables
1693+
! write(fates_log(),*) 'Updating litterfluxes: key:', this%GetRegistryVariableKey(j)
16921694
call this%hlm_vars(j)%Update(this%fates_vars(j), scalar=dtime)
16931695

1696+
! Dump HLM variable
1697+
! write(fates_log(),*) 'Dumping HLM variable'
1698+
! call this%hlm_vars(j)%Dump()
1699+
! write(fates_log(),*) 'Dumping FATES variable'
1700+
! call this%fates_vars(j)%Dump()
1701+
16941702
end do
16951703

16961704
! Update the HLM variable with the total litterfall
1705+
! write(fates_log(),*) 'Updating total litterfall'
16971706
j = this%GetRegistryVariableIndex(hlm_fates_litter_carbon_total)
16981707
call this%hlm_vars(j)%Update(this%fates_vars(j))
16991708

17001709
if (hlm_parteh_mode == prt_cnp_flex_allom_hyp) then
17011710
j = this%GetRegistryVariableIndex(hlm_fates_litter_phosphorus_total)
17021711
call this%hlm_vars(j)%Update(this%fates_vars(j))
17031712

1713+
! Dump HLM variable
1714+
! write(fates_log(),*) 'Dumping HLM variable'
1715+
! call this%hlm_vars(j)%Dump()
1716+
! write(fates_log(),*) 'Dumping FATES variable'
1717+
! call this%fates_vars(j)%Dump()
1718+
17041719
j = this%GetRegistryVariableIndex(hlm_fates_litter_nitrogen_total)
17051720
call this%hlm_vars(j)%Update(this%fates_vars(j))
1721+
1722+
! Dump HLM variable
1723+
! write(fates_log(),*) 'Dumping HLM variable'
1724+
! call this%hlm_vars(j)%Dump()
1725+
! write(fates_log(),*) 'Dumping FATES variable'
1726+
! call this%fates_vars(j)%Dump()
1727+
1728+
! write(fates_log(),*) 'Finished updating litter fluxes'
1729+
17061730
end if
17071731

17081732

0 commit comments

Comments
 (0)