Skip to content

Commit 44d45f5

Browse files
authored
Merge pull request #426 from rgknox/fixes-debug-xlf
Changed DEBUG logicals to lowercase (debug).
2 parents b2e89f3 + 458be7f commit 44d45f5

11 files changed

+99
-100
lines changed

biogeochem/EDCanopyStructureMod.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module EDCanopyStructureMod
3939
public :: canopy_summarization
4040
public :: update_hlm_dynamics
4141

42-
logical, parameter :: DEBUG=.false.
42+
logical, parameter :: debug=.false.
4343

4444
character(len=*), parameter, private :: sourcefile = &
4545
__FILE__
@@ -967,7 +967,7 @@ subroutine canopy_summarization( nsites, sites, bc_in )
967967

968968
!----------------------------------------------------------------------
969969

970-
if ( DEBUG ) then
970+
if ( debug ) then
971971
write(fates_log(),*) 'in canopy_summarization'
972972
endif
973973

@@ -1275,12 +1275,12 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
12751275
! no m2 of leaf per m2 of ground in each height class
12761276
! FIX(SPM,032414) these should be uncommented this and double check
12771277

1278-
if ( DEBUG ) write(fates_log(), *) 'leaf_area_profile()', currentPatch%elai_profile(1,ft,iv)
1278+
if ( debug ) write(fates_log(), *) 'leaf_area_profile()', currentPatch%elai_profile(1,ft,iv)
12791279

12801280
currentPatch%elai_profile(1,ft,iv) = currentPatch%tlai_profile(1,ft,iv) * fraction_exposed
12811281
currentPatch%esai_profile(1,ft,iv) = currentPatch%tsai_profile(1,ft,iv) * fraction_exposed
12821282

1283-
if ( DEBUG ) write(fates_log(), *) 'leaf_area_profile()', currentPatch%elai_profile(1,ft,iv)
1283+
if ( debug ) write(fates_log(), *) 'leaf_area_profile()', currentPatch%elai_profile(1,ft,iv)
12841284

12851285
enddo ! (iv) hite bins
12861286

@@ -1466,7 +1466,7 @@ subroutine leaf_area_profile( currentSite , snow_depth_si, frac_sno_eff_si)
14661466
do cl = 1,currentPatch%NCL_p
14671467
do iv = 1,currentPatch%ncan(cl,ft)
14681468

1469-
if( DEBUG .and. sum(currentPatch%canopy_area_profile(cl,:,iv)) > 1.0001_r8 ) then
1469+
if( debug .and. sum(currentPatch%canopy_area_profile(cl,:,iv)) > 1.0001_r8 ) then
14701470

14711471
write(fates_log(), *) 'FATES: A canopy_area_profile exceeded 1.0'
14721472
write(fates_log(), *) 'cl: ',cl
@@ -1678,7 +1678,7 @@ subroutine update_hlm_dynamics(nsites,sites,fcolumn,bc_out)
16781678
call endrun(msg=errMsg(sourcefile, __LINE__))
16791679
end if
16801680

1681-
if(DEBUG) then
1681+
if(debug) then
16821682
write(fates_log(),*) 'imprecise patch areas in update_hlm_dynamics',total_patch_area
16831683
end if
16841684

biogeochem/EDCohortDynamicsMod.F90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module EDCohortDynamicsMod
5252
public :: copy_cohort
5353
public :: count_cohorts
5454

55-
logical, parameter :: DEBUG = .false. ! local debug flag
55+
logical, parameter :: debug = .false. ! local debug flag
5656

5757
character(len=*), parameter, private :: sourcefile = &
5858
__FILE__
@@ -436,7 +436,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
436436
! Check if number density is so low is breaks math (level 1)
437437
if (currentcohort%n < min_n_safemath .and. level == 1) then
438438
terminate = 1
439-
if ( DEBUG ) then
439+
if ( debug ) then
440440
write(fates_log(),*) 'terminating cohorts 0',currentCohort%n/currentPatch%area,currentCohort%dbh
441441
endif
442442
endif
@@ -450,15 +450,15 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
450450
(currentCohort%dbh < 0.00001_r8.and.currentCohort%bstore < 0._r8) ) then
451451
terminate = 1
452452

453-
if ( DEBUG ) then
453+
if ( debug ) then
454454
write(fates_log(),*) 'terminating cohorts 1',currentCohort%n/currentPatch%area,currentCohort%dbh
455455
endif
456456
endif
457457

458458
! In the third canopy layer
459459
if (currentCohort%canopy_layer > nclmax ) then
460460
terminate = 1
461-
if ( DEBUG ) then
461+
if ( debug ) then
462462
write(fates_log(),*) 'terminating cohorts 2', currentCohort%canopy_layer
463463
endif
464464
endif
@@ -467,7 +467,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
467467
if ( (currentCohort%bsw+currentCohort%bl+currentCohort%br) < 1e-10_r8 .or. &
468468
currentCohort%bstore < 1e-10_r8) then
469469
terminate = 1
470-
if ( DEBUG ) then
470+
if ( debug ) then
471471
write(fates_log(),*) 'terminating cohorts 3', &
472472
currentCohort%bsw,currentCohort%bl,currentCohort%br,currentCohort%bstore
473473
endif
@@ -476,7 +476,7 @@ subroutine terminate_cohorts( currentSite, currentPatch, level )
476476
! Total cohort biomass is negative
477477
if ( (currentCohort%b_total()) < 0._r8) then
478478
terminate = 1
479-
if ( DEBUG ) then
479+
if ( debug ) then
480480
write(fates_log(),*) 'terminating cohorts 4', &
481481
currentCohort%bsw, &
482482
currentCohort%bl, &
@@ -602,7 +602,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
602602
real(r8) :: diff
603603
real(r8) :: dynamic_fusion_tolerance
604604

605-
logical, parameter :: FUSE_DEBUG = .false. ! This debug is over-verbose
605+
logical, parameter :: fuse_debug = .false. ! This debug is over-verbose
606606
! and gets its own flag
607607

608608
!----------------------------------------------------------------------
@@ -665,7 +665,7 @@ subroutine fuse_cohorts(currentSite, currentPatch, bc_in)
665665
newn = currentCohort%n + nextc%n
666666
fusion_took_place = 1
667667

668-
if ( FUSE_DEBUG .and. currentCohort%isnew ) then
668+
if ( fuse_debug .and. currentCohort%isnew ) then
669669
write(fates_log(),*) 'Fusing Two Cohorts'
670670
write(fates_log(),*) 'newn: ',newn
671671
write(fates_log(),*) 'Cohort I, Cohort II'
@@ -1147,8 +1147,8 @@ subroutine copy_cohort( currentCohort,copyc )
11471147
n%npp_tstep = o%npp_tstep
11481148
n%npp_acc = o%npp_acc
11491149

1150-
if ( DEBUG ) write(fates_log(),*) 'EDcohortDyn Ia ',o%npp_acc
1151-
if ( DEBUG ) write(fates_log(),*) 'EDcohortDyn Ib ',o%resp_acc
1150+
if ( debug ) write(fates_log(),*) 'EDcohortDyn Ia ',o%npp_acc
1151+
if ( debug ) write(fates_log(),*) 'EDcohortDyn Ib ',o%resp_acc
11521152

11531153
n%resp_tstep = o%resp_tstep
11541154
n%resp_acc = o%resp_acc
@@ -1213,7 +1213,7 @@ subroutine copy_cohort( currentCohort,copyc )
12131213
n%dbdeaddt = o%dbdeaddt
12141214
n%dbstoredt = o%dbstoredt
12151215

1216-
if ( DEBUG ) write(fates_log(),*) 'EDCohortDyn dpstoredt ',o%dbstoredt
1216+
if ( debug ) write(fates_log(),*) 'EDCohortDyn dpstoredt ',o%dbstoredt
12171217

12181218
! FIRE
12191219
n%fraction_crown_burned = o%fraction_crown_burned

biogeochem/EDMortalityFunctionsMod.F90

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ module EDMortalityFunctionsMod
2828
public :: mortality_rates
2929
public :: Mortality_Derivative
3030

31-
logical :: DEBUG_growth = .false.
3231

3332
! ============================================================================
3433
! 10/30/09: Created by Rosie Fisher

biogeochem/EDPhysiologyMod.F90

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ module EDPhysiologyMod
7676
public :: flux_into_litter_pools
7777

7878

79-
logical, parameter :: DEBUG = .false. ! local debug flag
79+
logical, parameter :: debug = .false. ! local debug flag
8080
character(len=*), parameter, private :: sourcefile = &
8181
__FILE__
8282

@@ -296,7 +296,7 @@ subroutine trim_canopy( currentSite )
296296
if (currentCohort%year_net_uptake(z) < currentCohort%leaf_cost)then
297297
if (currentCohort%canopy_trim > EDPftvarcon_inst%trim_limit(ipft))then
298298

299-
if ( DEBUG ) then
299+
if ( debug ) then
300300
write(fates_log(),*) 'trimming leaves', &
301301
currentCohort%canopy_trim,currentCohort%leaf_cost
302302
endif
@@ -321,7 +321,7 @@ subroutine trim_canopy( currentSite )
321321
currentCohort%canopy_trim = currentCohort%canopy_trim + EDPftvarcon_inst%trim_inc(ipft)
322322
endif
323323

324-
if ( DEBUG ) then
324+
if ( debug ) then
325325
write(fates_log(),*) 'trimming',currentCohort%canopy_trim
326326
endif
327327

@@ -444,7 +444,7 @@ subroutine phenology( currentSite, bc_in )
444444
currentSite%status = 2 !alter status of site to 'leaves on'
445445
! NOTE(bja, 2015-01) should leafondate = model_day to be consistent with leaf off?
446446
currentSite%leafondate = t !record leaf on date
447-
if ( DEBUG ) write(fates_log(),*) 'leaves on'
447+
if ( debug ) write(fates_log(),*) 'leaves on'
448448
endif !ncd
449449
endif !status
450450
endif !GDD
@@ -464,7 +464,7 @@ subroutine phenology( currentSite, bc_in )
464464
if (currentSite%status == 2)then
465465
currentSite%status = 1 !alter status of site to 'leaves on'
466466
currentSite%leafoffdate = hlm_model_day !record leaf off date
467-
if ( DEBUG ) write(fates_log(),*) 'leaves off'
467+
if ( debug ) write(fates_log(),*) 'leaves off'
468468
endif
469469
endif
470470
endif
@@ -474,7 +474,7 @@ subroutine phenology( currentSite, bc_in )
474474
if(currentSite%status == 2)then
475475
currentSite%status = 1 !alter status of site to 'leaves on'
476476
currentSite%leafoffdate = hlm_model_day !record leaf off date
477-
if ( DEBUG ) write(fates_log(),*) 'leaves off'
477+
if ( debug ) write(fates_log(),*) 'leaves off'
478478
endif
479479
endif
480480

@@ -625,11 +625,11 @@ subroutine phenology_leafonoff(currentSite)
625625
endif
626626

627627

628-
if ( DEBUG ) write(fates_log(),*) 'EDPhysMod 1 ',currentCohort%bstore
628+
if ( debug ) write(fates_log(),*) 'EDPhysMod 1 ',currentCohort%bstore
629629

630630
currentCohort%bstore = currentCohort%bstore - currentCohort%bl ! Drain store
631631

632-
if ( DEBUG ) write(fates_log(),*) 'EDPhysMod 2 ',currentCohort%bstore
632+
if ( debug ) write(fates_log(),*) 'EDPhysMod 2 ',currentCohort%bstore
633633

634634
currentCohort%laimemory = 0.0_r8
635635

@@ -665,11 +665,11 @@ subroutine phenology_leafonoff(currentSite)
665665
currentCohort%bl = currentCohort%bstore * store_output
666666
endif
667667

668-
if ( DEBUG ) write(fates_log(),*) 'EDPhysMod 3 ',currentCohort%bstore
668+
if ( debug ) write(fates_log(),*) 'EDPhysMod 3 ',currentCohort%bstore
669669

670670
currentCohort%bstore = currentCohort%bstore - currentCohort%bl ! empty store
671671

672-
if ( DEBUG ) write(fates_log(),*) 'EDPhysMod 4 ',currentCohort%bstore
672+
if ( debug ) write(fates_log(),*) 'EDPhysMod 4 ',currentCohort%bstore
673673

674674
currentCohort%laimemory = 0.0_r8
675675

@@ -1742,7 +1742,7 @@ subroutine recruitment( currentSite, currentPatch, bc_in )
17421742
endif
17431743

17441744
if (temp_cohort%n > 0.0_r8 )then
1745-
if ( DEBUG ) write(fates_log(),*) 'EDPhysiologyMod.F90 call create_cohort '
1745+
if ( debug ) write(fates_log(),*) 'EDPhysiologyMod.F90 call create_cohort '
17461746
call create_cohort(currentSite,currentPatch, temp_cohort%pft, temp_cohort%n, temp_cohort%hite, temp_cohort%dbh, &
17471747
b_leaf, b_fineroot, b_sapwood, temp_cohort%bdead, temp_cohort%bstore, &
17481748
temp_cohort%laimemory, cohortstatus,recruitstatus, temp_cohort%canopy_trim, currentPatch%NCL_p, &

biogeophys/EDAccumulateFluxesMod.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module EDAccumulateFluxesMod
1818
!
1919
public :: AccumulateFluxes_ED
2020

21-
logical :: DEBUG = .false. ! for debugging this module
21+
logical :: debug = .false. ! for debugging this module
2222

2323
character(len=*), parameter, private :: sourcefile = &
2424
__FILE__
@@ -72,7 +72,7 @@ subroutine AccumulateFluxes_ED(nsites, sites, bc_in, bc_out, dt_time)
7272
! Accumulate fluxes from hourly to daily values.
7373
! _tstep fluxes are KgC/indiv/timestep _acc are KgC/indiv/day
7474

75-
if ( DEBUG ) then
75+
if ( debug ) then
7676

7777
write(fates_log(),*) 'EDAccumFlux 64 ',ccohort%npp_tstep
7878
write(fates_log(),*) 'EDAccumFlux 66 ',ccohort%gpp_tstep

biogeophys/EDSurfaceAlbedoMod.F90

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module EDSurfaceRadiationMod
3939
public :: ED_Norman_Radiation ! Surface albedo and two-stream fluxes
4040
public :: ED_SunShadeFracs
4141

42-
logical :: DEBUG = .false. ! for debugging this module
42+
logical :: debug = .false. ! for debugging this module
4343

4444

4545
real(r8), public :: albice(maxSWb) = & ! albedo land ice by waveband (1=vis, 2=nir)
@@ -712,7 +712,7 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out )
712712
if (ib == ivis) then ! only set the absorbed PAR for the visible light band.
713713
do iv = 1, currentPatch%nrad(L,ft)
714714
if (radtype==idirect) then
715-
if ( DEBUG ) then
715+
if ( debug ) then
716716
write(fates_log(),*) 'EDsurfAlb 730 ',Abs_dif_z(ft,iv),currentPatch%f_sun(L,ft,iv)
717717
write(fates_log(),*) 'EDsurfAlb 731 ', currentPatch%fabd_sha_z(L,ft,iv), &
718718
currentPatch%fabd_sun_z(L,ft,iv)
@@ -728,7 +728,7 @@ subroutine ED_Norman_Radiation (nsites, sites, bc_in, bc_out )
728728
currentPatch%fabi_sun_z(L,ft,iv) = Abs_dif_z(ft,iv) * &
729729
currentPatch%f_sun(L,ft,iv)
730730
endif
731-
if ( DEBUG ) then
731+
if ( debug ) then
732732
write(fates_log(),*) 'EDsurfAlb 740 ', currentPatch%fabd_sha_z(L,ft,iv), &
733733
currentPatch%fabd_sun_z(L,ft,iv)
734734
endif
@@ -979,7 +979,7 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
979979

980980
ifp=ifp+1
981981

982-
if( DEBUG ) write(fates_log(),*) 'edsurfRad_5600',ifp,s,cpatch%NCL_p,numpft
982+
if( debug ) write(fates_log(),*) 'edsurfRad_5600',ifp,s,cpatch%NCL_p,numpft
983983

984984
! zero out various datas
985985
cpatch%ed_parsun_z(:,:,:) = 0._r8
@@ -1007,7 +1007,7 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
10071007
do CL = 1, cpatch%NCL_p
10081008
do FT = 1,numpft
10091009

1010-
if( DEBUG ) write(fates_log(),*) 'edsurfRad_5601',CL,FT,cpatch%nrad(CL,ft)
1010+
if( debug ) write(fates_log(),*) 'edsurfRad_5601',CL,FT,cpatch%nrad(CL,ft)
10111011

10121012
do iv = 1, cpatch%nrad(CL,ft) !NORMAL CASE.
10131013

@@ -1017,8 +1017,8 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
10171017
cpatch%ed_laisun_z(CL,ft,iv) = cpatch%elai_profile(CL,ft,iv) * &
10181018
cpatch%f_sun(CL,ft,iv)
10191019

1020-
if ( DEBUG ) write(fates_log(),*) 'edsurfRad 570 ',cpatch%elai_profile(CL,ft,iv)
1021-
if ( DEBUG ) write(fates_log(),*) 'edsurfRad 571 ',cpatch%f_sun(CL,ft,iv)
1020+
if ( debug ) write(fates_log(),*) 'edsurfRad 570 ',cpatch%elai_profile(CL,ft,iv)
1021+
if ( debug ) write(fates_log(),*) 'edsurfRad 571 ',cpatch%f_sun(CL,ft,iv)
10221022

10231023
cpatch%ed_laisha_z(CL,ft,iv) = cpatch%elai_profile(CL,ft,iv) * &
10241024
(1._r8 - cpatch%f_sun(CL,ft,iv))
@@ -1052,16 +1052,16 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
10521052
! If sun/shade big leaf code, nrad=1 and fluxes from SurfaceAlbedo
10531053
! are canopy integrated so that layer values equal big leaf values.
10541054

1055-
if ( DEBUG ) write(fates_log(),*) 'edsurfRad 645 ',cpatch%NCL_p,numpft
1055+
if ( debug ) write(fates_log(),*) 'edsurfRad 645 ',cpatch%NCL_p,numpft
10561056

10571057
do CL = 1, cpatch%NCL_p
10581058
do FT = 1,numpft
10591059

1060-
if ( DEBUG ) write(fates_log(),*) 'edsurfRad 649 ',cpatch%nrad(CL,ft)
1060+
if ( debug ) write(fates_log(),*) 'edsurfRad 649 ',cpatch%nrad(CL,ft)
10611061

10621062
do iv = 1, cpatch%nrad(CL,ft)
10631063

1064-
if ( DEBUG ) then
1064+
if ( debug ) then
10651065
write(fates_log(),*) 'edsurfRad 653 ', cpatch%ed_parsun_z(CL,ft,iv)
10661066
write(fates_log(),*) 'edsurfRad 654 ', bc_in(s)%solad_parb(ifp,ipar)
10671067
write(fates_log(),*) 'edsurfRad 655 ', bc_in(s)%solai_parb(ifp,ipar)
@@ -1073,13 +1073,13 @@ subroutine ED_SunShadeFracs(nsites, sites,bc_in,bc_out)
10731073
bc_in(s)%solad_parb(ifp,ipar)*cpatch%fabd_sun_z(CL,ft,iv) + &
10741074
bc_in(s)%solai_parb(ifp,ipar)*cpatch%fabi_sun_z(CL,ft,iv)
10751075

1076-
if ( DEBUG )write(fates_log(),*) 'edsurfRad 663 ', cpatch%ed_parsun_z(CL,ft,iv)
1076+
if ( debug )write(fates_log(),*) 'edsurfRad 663 ', cpatch%ed_parsun_z(CL,ft,iv)
10771077

10781078
cpatch%ed_parsha_z(CL,ft,iv) = &
10791079
bc_in(s)%solad_parb(ifp,ipar)*cpatch%fabd_sha_z(CL,ft,iv) + &
10801080
bc_in(s)%solai_parb(ifp,ipar)*cpatch%fabi_sha_z(CL,ft,iv)
10811081

1082-
if ( DEBUG ) write(fates_log(),*) 'edsurfRad 669 ', cpatch%ed_parsha_z(CL,ft,iv)
1082+
if ( debug ) write(fates_log(),*) 'edsurfRad 669 ', cpatch%ed_parsha_z(CL,ft,iv)
10831083

10841084
end do !iv
10851085
end do !FT

0 commit comments

Comments
 (0)