Skip to content

Commit a72c92c

Browse files
committed
bug fix in accordance with the bgc simulations
With the cent_bgc on, it turned out some tracer number counters were not appropriately calculated. This fixes the problem. The default tests were not affected. test: configure & build: pass, edison, intel compiler unit test: pass regression test: pass mtest: pas
1 parent 9ca50e2 commit a72c92c

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

src/betr/betr_core/BeTRTracerType.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ subroutine Init(this)
123123
implicit none
124124
class(BeTRtracer_type), intent(inout) :: this
125125

126-
this%ntracers=this%ngwmobile_tracers+this%nsolid_passive_tracers
127126
this%ntracer_groups = this%nsolid_passive_tracer_groups + this%ngwmobile_tracer_groups
128127

129128
call this%InitAllocate()

src/betr/betr_core/TracerStateType.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ subroutine InitAllocate(this, bounds, lbj, ubj, betrtracer_vars)
120120
this%tracer_conc_atm_col (:,:) = nan
121121
allocate(this%tracer_conc_mobile_col (begc:endc, lbj:ubj, 1:ntracers))
122122
this%tracer_conc_mobile_col (:,:,:) = nan
123-
print*,'equil_solid',nsolid_equil_tracers
124123
allocate(this%tracer_conc_solid_equil_col (begc:endc, lbj:ubj, 1:nsolid_equil_tracers))
125124
this%tracer_conc_solid_equil_col (:,:,:) = nan
126125

src/betr/betr_main/TracerBalanceMod.F90

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,18 @@ subroutine betr_tracer_mass_summary(bounds, col, lbj, ubj, numf, filter, betrtra
217217
tracer_molarmass_col(c,jj) = &
218218
tracerstate_vars%int_mass_mobile_col(1,nlevtrc_soil,c,jj,dz(c,1:nlevtrc_soil),betr_status)
219219
if(betr_status%check_status())return
220-
print*,'mass1',betrtracer_vars%tracernames(jj),tracer_molarmass_col(c,jj)
221-
if(trim(betrtracer_vars%tracernames(jj))=='P_SOL')print*,tracer_conc_mobile(c,:,jj)
222220
if(is_adsorb(jj))then
223221
tracer_molarmass_col(c,jj) = tracer_molarmass_col(c,jj) + &
224222
tracerstate_vars%int_mass_adsorb_col(1,nlevtrc_soil,c,adsorbid(jj),&
225223
dz(c,1:nlevtrc_soil),betr_status)
226224
if(betr_status%check_status())return
227225
endif
228-
print*,'mass2',betrtracer_vars%tracernames(jj),tracer_molarmass_col(c,jj)
229226
if(is_frozen(jj))then
230227
tracer_molarmass_col(c,jj) = tracer_molarmass_col(c,jj) + &
231228
tracerstate_vars%int_mass_frozen_col(1,nlevtrc_soil,c,&
232229
frozenid(jj),dz(c,1:nlevtrc_soil),betr_status)
233230
if(betr_status%check_status())return
234231
endif
235-
print*,'mass3',betrtracer_vars%tracernames(jj),tracer_molarmass_col(c,jj)
236232
enddo
237233
enddo
238234
end associate

src/driver/shared/BeTRType.F90

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,18 @@ subroutine step_without_drainage(this, betr_time, bounds, col, pft, &
311311
this%tracerboundaryconds, this%tracerfluxes, this%bgc_reaction, &
312312
Rfactor, this%advection_on, betr_status)
313313
if(betr_status%check_status())return
314-
314+
! print*,'bf hydro'
315+
! do j = 1, this%tracers%ntracers
316+
! print*,j,this%tracers%tracernames(j),this%tracerstates%tracer_conc_mobile_col(1,1,j)
317+
! enddo
315318
call surface_tracer_hydropath_update(betr_time, bounds, col, &
316319
num_soilc, filter_soilc, biophysforc, this%tracers, this%tracerstates, &
317320
this%tracercoeffs, this%tracerfluxes, betr_status)
318321
if(betr_status%check_status())return
319-
322+
! print*,'bf reaction'
323+
! do j = 1, this%tracers%ntracers
324+
! print*,j,this%tracers%tracernames(j),this%tracerstates%tracer_conc_mobile_col(1,1,j)
325+
! enddo
320326
if(this%reaction_on) &
321327
call this%bgc_reaction%calc_bgc_reaction(bounds, col, lbj, ubj, &
322328
num_soilc, &
@@ -333,6 +339,11 @@ subroutine step_without_drainage(this, betr_time, bounds, col, pft, &
333339
this%tracerboundaryconds, &
334340
this%plant_soilbgc, biogeo_flux, betr_status)
335341
if(betr_status%check_status())return
342+
! print*,'af reaction'
343+
! do j = 1, this%tracers%ntracers
344+
! print*,j,this%tracers%tracernames(j),this%tracerstates%tracer_conc_mobile_col(1,1,j)
345+
! enddo
346+
336347
call tracer_gws_transport(betr_time, bounds, col, pft, num_soilc, filter_soilc, &
337348
Rfactor, biophysforc, biogeo_flux, this%tracers, this%tracerboundaryconds , &
338349
this%tracercoeffs, this%tracerstates, this%tracerfluxes, this%bgc_reaction, &
@@ -355,7 +366,12 @@ subroutine step_without_drainage(this, betr_time, bounds, col, pft, &
355366
this%tracerfluxes%tracer_flx_ebu_col(bounds%begc:bounds%endc, 1:this%tracers%nvolatile_tracers), &
356367
this%ebullition_on, betr_status)
357368
if(betr_status%check_status())return
358-
369+
! do j = 1, this%tracers%ntracers
370+
! if(this%tracers%is_adsorb(j) .or. trim(this%tracers%tracernames(j))=='P_SOL')then
371+
! print*,this%tracers%tracernames(j)
372+
! print*,this%tracerstates%tracer_conc_mobile_col(1,:,j)
373+
! endif
374+
! enddo
359375
!update nitrogen storage pool
360376
call this%plant_soilbgc%plant_soilbgc_summary(bounds, lbj, ubj, pft, &
361377
num_soilc, filter_soilc, dtime , &

0 commit comments

Comments
 (0)