Skip to content

Commit

Permalink
Made changes according to boundary
Browse files Browse the repository at this point in the history
  • Loading branch information
Volodymyr Kondratenko committed Sep 8, 2010
1 parent ae3c2ed commit fe144a8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 84 deletions.
115 changes: 32 additions & 83 deletions wrfv2_fire/phys/module_fr_sfire_core.F
Expand Up @@ -224,8 +224,8 @@ end subroutine ignite_fire
!**********************
!

subroutine fuel_left(&
ifds,ifde,jfds,jfde&
subroutine fuel_left( &
ifds,ifde,jfds,jfde, &
ims,ime,jms,jme, &
its,ite,jts,jte, &
ifs,ife,jfs,jfe, &
Expand Down Expand Up @@ -303,79 +303,26 @@ subroutine fuel_left(&
! Loop over cells in Tile
! Changes made by Volodymyr Kondratenko 09/24/2009
its1=max(its,ifds+1)
do icl=its1,ite
do jcl=jts,jte
ite1=min(ite,ifde-1)
jts1=max(jts,jfds+1)
jte1=min(jte,jfde-1)
write(*,*)"fuel_left_method",fuel_left_method
do icl=its1,ite1
do jcl=jts1,jte1
helpsum1=0
helpsum2=0

if (icl.eq.ifs) then
if (lfn(icl,jcl).lt.0) then
call crash('tign_interp: lfn on the boundary should be not burning but &
lfn<0, when icl=its ')
elseif (jcl.eq.jfs) then
call tign_lfn_interpolation(time_now,icl+1,jcl+1,ims,ime,jms,jme, &
tign,lfn,tff,lff)

elseif (jcl.eq.jfe) then
call tign_lfn_interpolation(time_now,icl+1,jcl-1,ims,ime,jms,jme, &
tign,lfn,tff,lff)
else

call tign_lfn_interpolation(time_now,icl+1,jcl,ims,ime,jms,jme, &
tign,lfn,tff,lff)
endif

elseif (icl.eq.ife) then
if (lfn(icl,jcl).lt.0) then
call crash('tign_interp: lfn on the boundary should be not burning but &
lfn<0 when icl=ite')

elseif (jcl.eq.jfs) then
call tign_lfn_interpolation(time_now,icl-1,jcl+1,ims,ime,jms,jme, &
tign,lfn,tff,lff)

elseif (jcl.eq.jfe) then
call tign_lfn_interpolation(time_now,icl-1,jcl-1,ims,ime,jms,jme, &
tign,lfn,tff,lff)
else

call tign_lfn_interpolation(time_now,icl-1,jcl,ims,ime,jms,jme, &
tign,lfn,tff,lff)
endif

elseif (jcl.eq.jfs) then
if (lfn(icl,jcl).lt.0) then
call crash('tign_interp: lfn on the boundary should be not burning but &
lfn<0 when icl=ite')

else
call tign_lfn_interpolation(time_now,icl,jcl+1,ims,ime,jms,jme, &
tign,lfn,tff,lff)
endif

elseif (jcl.eq.jfe) then
if (lfn(icl,jcl).lt.0) then
call crash('tign_interp: lfn on the boundary should be not burning but &
lfn<0 when icl=ite')

else
call tign_lfn_interpolation(time_now,icl,jcl-1,ims,ime,jms,jme, &
tign,lfn,tff,lff)
endif
else



! Loop over subcells in cell #(icl,jcl)
write(*,*)"ifs,ife",ifs,ife
write(*,*)"jfs,jfe",jfs,jfe
write(*,*)"ifds,ifde",ifds,ifde
write(*,*)"jfds,jfde",jfds,jfde
write(*,*)"its,ite,jts,jte",its,ite,jts,jte
write(*,*)"ims,ime,jms,jme",ims,ime,jms,jme
write(*,*)"icl,jcl",icl,jcl


call tign_lfn_interpolation(time_now,icl,jcl,ims,ime,jms,jme, &
tign,lfn,tff,lff)
endif
!endif

do isubcl=1,ir
do jsubcl=1,jr
Expand Down Expand Up @@ -411,11 +358,13 @@ subroutine fuel_left(&
helpsum2=helpsum2+fire_area_ff
enddo
enddo
write(*,*)"fuel_frac",helpsum1
fuel_frac(icl,jcl)=helpsum1
fire_area(icl,jcl)=helpsum2
enddo
enddo


write(*,*)"finish"



Expand All @@ -435,23 +384,23 @@ subroutine fuel_left(&
enddo

! consistency check after sum
fmax=0
do j=jts,jte
do i=its,ite
if(fire_area(i,j).eq.0.)then
if(fuel_frac(i,j).lt.1.-1e-6)then
!$OMP CRITICAL(SFIRE_CORE_CRIT)
write(msg,'(a,2i6,2(a,f11.8))')'fuel_left: at node',i,j, &
' fuel burnt',1-fuel_frac(i,j),' but fire area',fire_area(i,j)
!$OMP END CRITICAL(SFIRE_CORE_CRIT)
call crash(msg)
endif
else
frat=(1-fuel_frac(i,j))/fire_area(i,j)
fmax=max(fmax,frat)
endif
enddo
enddo
!fmax=0
!do j=jts,jte
! do i=its,ite
! if(fire_area(i,j).eq.0.)then
! if(fuel_frac(i,j).lt.1.-1e-6)then
!!$OMP CRITICAL(SFIRE_CORE_CRIT)
! write(msg,'(a,2i6,2(a,f11.8))')'fuel_left: at node',i,j, &
! ' fuel burnt',1-fuel_frac(i,j),' but fire area',fire_area(i,j)
!!$OMP END CRITICAL(SFIRE_CORE_CRIT)
! call crash(msg)
! endif
! else
! frat=(1-fuel_frac(i,j))/fire_area(i,j)
! fmax=max(fmax,frat)
! endif
! enddo
!enddo
!$OMP CRITICAL(SFIRE_CORE_CRIT)
write(msg,'(a,4i6,a,f10.7)')'fuel_left: tile',its,ite,jts,jte,' max fuel burnt/area',fmax
!$OMP END CRITICAL(SFIRE_CORE_CRIT)
Expand Down
1 change: 1 addition & 0 deletions wrfv2_fire/phys/module_fr_sfire_model.F
Expand Up @@ -317,6 +317,7 @@ subroutine sfire_model ( &
! compute the heat fluxes from the fuel burned
! needs lfn and tign from neighbors so halo must be updated before
call fuel_left(&
ifds,ifde,jfds,jfde, &
ifms,ifme,jfms,jfme, &
ifts,ifte,jfts,jfte, &
ifts,ifte,jfts,jfte, &
Expand Down
2 changes: 1 addition & 1 deletion wrfv2_fire/test/em_fire/small/namelist.input
Expand Up @@ -182,7 +182,7 @@
fire_grows_only=1, ! if >0 level set function cannot increase = fire can only grow
fire_viscosity=0.4, ! artificial viscosity in level set method (max 1, needed with fire_upwinding=0)
fire_upwinding=3, ! 0=none, 1=standard, 2=godunov, 3=eno, 4=sethian
fire_fuel_left_method=1, ! for now, use 1 only
fire_fuel_left_method=2, ! for now, use 1 only
fire_lfn_ext_up=1.0, ! 0.=extend level set function at boundary by reflection, 1.=always up
fire_advection=0, ! 0 = cawfe, 1 = use abs speed/slope in spread rate, then project on normal to fireline
/

0 comments on commit fe144a8

Please sign in to comment.