Commit 701d705c authored by ronesy's avatar ronesy
Browse files

Corrected use of lsm

parent 958b442e
......@@ -32,7 +32,7 @@
!! are >99% water are given negative numbers while boxes that are land are
!! given positive numbers.
!!
!! Options: (defined in SETTINGS_regions)
!! Options (defined in SETTINGS):
!! useflux - (true/false) weight surface influence by annual fluxes
!! uselanduse - (true/false) avoid gridcells with > 99% water
!! nmap - (integer) number of resolution steps to use
......@@ -90,6 +90,7 @@ subroutine map_grid(config, flux, surfinf, nbox_xy)
contrib_lump(:,:) = 0.
sort_contrib(:) = 0.
water_box(:) = 0.
water(:,:) = 0.
! mean flux
flux_av = sum(flux)/float(nxregrid*nyregrid)
......@@ -135,13 +136,13 @@ subroutine map_grid(config, flux, surfinf, nbox_xy)
if (useflux) then
! contrib_lump : surface influence times flux
! take a certain minimum flux flux for sorting
contrib_lump(nfx,nfy) = contrib_lump(nfx,nfy) + surfinf(ix+i1,jy+j1) * flux(ix+i1,jy+j1)/flux_av
contrib_lump(nfx,nfy) = contrib_lump(nfx,nfy) + surfinf(ix+i1,jy+j1) * abs(flux(ix+i1,jy+j1))/flux_av
else
! contrib_lump : surface influence only
contrib_lump(nfx,nfy) = contrib_lump(nfx,nfy) + surfinf(ix+i1,jy+j1)
endif
if( uselanduse ) then
water(nfx,nfy) = water(nfx,nfy) + (1 - lsm(ix+i1,jy+j1))
water(nfx,nfy) = water(nfx,nfy) + (1. - lsm(ix+i1,jy+j1))
else
! set to zero to avoid landuse consideration
water(nfx,nfy) = 0.
......@@ -224,7 +225,7 @@ subroutine map_grid(config, flux, surfinf, nbox_xy)
x_map(nb) = ix
y_map(nb) = jy
sens_map(nb) = surfinf(ix,jy)
water_box(nb) = water(ix,jy)
water_box(nb) = 1. - lsm(ix,jy)
nbox_xy(ix,jy) = nb
endif
end do ! nxregrid
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment