Skip to content

Commit

Permalink
Spitfire bugfixes and remove compile time switch for spitfire
Browse files Browse the repository at this point in the history
Merge branch 'rosie/spitfire_cleanup'

Turns on SPITFIRE by changing the previously always-off hard-wired
temporary switch. Makes use_ed_spitfire off by default. Adds a single
test for when spitfire is on. Fixes two science bugs in the litter
moisture and wind effect algorithms.

Fixes: #22, #140

User interface changes?: use_ed_spit_fire namelist switch now works.

Code review: Ben Andre. Rosie Fisher. Jackie Shuman, Ryan Knox

rosie:
    Test suite: ed , clm_short_45, clm_short_50 - yellowstone, intel
    Test baseline: ed-clm-44aac42, clm4_5_12_r195
    Test namelist changes: ?
    Test answer changes: changes answers when fire is on (expected)

andre:
   Test suite: ed - yellowstone gnu, intel, pgi
               ed - hobart nag
   Test baseline: 2ac7960
   Test namelist changes: yes, changes default of use_ed_spit_fire
                          from on too off.
   Test answer changes: all tests pass, bit for bit for existing tests
                        where fire is off; no baseline for new test
                        with fire on.

   Test suite: clm_short - yellowstone gnu, intel, pgi
   Test baseline: clm4_5_12_r195
   Test namelist changes: none
   Test answer changes: all tests pass, bit for bit
  • Loading branch information
bandre-ucar committed Dec 1, 2016
2 parents 2ac7960 + 2560ea1 commit 1d7f88a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1973,6 +1973,6 @@ lnd/clm2/surfdata_map/surfdata_ne120np4_78pfts_simyr1850_c160216.nc</fsurdat>
<use_lch4 bgc_mode="ed" >.false.</use_lch4>
<use_nitrif_denitrif bgc_mode="ed" >.false.</use_nitrif_denitrif>

<use_ed_spit_fire use_ed=".true.">.true.</use_ed_spit_fire>
<use_ed_spit_fire use_ed=".true.">.false.</use_ed_spit_fire>

</namelist_defaults>
10 changes: 5 additions & 5 deletions components/clm/cime_config/testdefs/testlist_clm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,8 @@
<grid name="1x1_brazil">
<test name="ERS_D_Mmpi-serial_Ld5">
<machine compiler="ed" testtype="ed" testmods="clm/edTest">ed</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="nag" testtype="aux_clm45" testmods="clm/edTest">hobart</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="gnu" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
<machine compiler="intel" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
<machine compiler="pgi" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
Expand All @@ -709,8 +709,8 @@
</test>
<test name="SMS_D_Mmpi-serial_Ld5">
<machine compiler="ed" testtype="ed" testmods="clm/edTest">ed</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="nag" testtype="aux_clm45" testmods="clm/edTest">hobart</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="intel" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
<machine compiler="pgi" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
</test>
Expand All @@ -724,15 +724,15 @@
<grid name="f10_f10">
<test name="ERS_D_Ld5">
<machine compiler="ed" testtype="ed" testmods="clm/edTest">ed</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edNoFire">ed</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edFire">ed</machine>
<machine compiler="nag" testtype="aux_clm45" testmods="clm/edTest">hobart</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="intel" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
</test>
<test name="SMS_D_Ld5">
<machine compiler="ed" testtype="ed" testmods="clm/edTest">ed</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="nag" testtype="aux_clm45" testmods="clm/edTest">hobart</machine>
<machine compiler="ed" testtype="ed" testmods="clm/edTest">hobart</machine>
<machine compiler="gnu" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
<machine compiler="intel" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
<machine compiler="pgi" testtype="aux_clm45" testmods="clm/edTest">yellowstone</machine>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use_ed_spit_fire = .true.

This file was deleted.

9 changes: 3 additions & 6 deletions components/clm/src/ED/fire/SFMainMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,8 @@ subroutine fire_model( currentSite, atm2lnd_inst, temperature_inst)

type (ed_patch_type), pointer :: currentPatch

integer temporary_SF_switch

!zero fire things
currentPatch => currentSite%youngest_patch
temporary_SF_switch = 0
do while(associated(currentPatch))
currentPatch%frac_burnt = 0.0_r8
currentPatch%AB = 0.0_r8
Expand All @@ -68,7 +65,7 @@ subroutine fire_model( currentSite, atm2lnd_inst, temperature_inst)
write(iulog,*) 'use_ed_spit_fire',use_ed_spit_fire
endif

if(use_ed_spit_fire.and.temporary_SF_switch==1)then
if(use_ed_spit_fire)then
call fire_danger_index(currentSite, temperature_inst, atm2lnd_inst)
call wind_effect(currentSite, atm2lnd_inst)
call charecteristics_of_fuel(currentSite)
Expand Down Expand Up @@ -222,7 +219,7 @@ subroutine charecteristics_of_fuel ( currentSite )
! average water content !is this the correct metric?
timeav_swc = sum(currentSite%water_memory(1:10)) / 10._r8
! Equation B2 in Thonicke et al. 2010
fuel_moisture(dg_sf) = max(0.0_r8, 10.0_r8/9._r8 * timeav_swc - 1.0_r8/9.0_r8)
fuel_moisture(lg_sf) = max(0.0_r8, 10.0_r8/9._r8 * timeav_swc - 1.0_r8/9.0_r8)

! Average properties over the first four litter pools (dead leaves, twigs, s branches, l branches)
currentPatch%fuel_bulkd = sum(currentPatch%fuel_frac(dg_sf:lb_sf) * SF_val_FBD(dg_sf:lb_sf))
Expand Down Expand Up @@ -363,7 +360,7 @@ subroutine wind_effect ( currentSite, atm2lnd_inst)

do while(associated(currentPatch))
currentPatch%total_tree_area = min(currentPatch%total_tree_area,currentPatch%area)
currentPatch%effect_wspeed = wind * (tree_fraction*0.6+grass_fraction*0.4+bare_fraction*1.0)
currentPatch%effect_wspeed = wind * (tree_fraction*0.4+(grass_fraction+bare_fraction)*0.6)

currentPatch => currentPatch%younger
enddo !end patch loop
Expand Down

0 comments on commit 1d7f88a

Please sign in to comment.