!*==erodinit.spg processed by SPAG 6.70Rc at 15:33 on 10 Dec 2012 !*------------------ SPAG Configuration Options -------------------- !*--0323,76 000101,-1 000000102011332010100002000000210211210,136 10 -- !*--1100000011112111000000000000,10,10,10,10,10,10,900,100 200000000 -- !*--000000010000000000000,72,72 73,42,38,33 00011112110000100000000 -- !*---------------------------------------------------------------------- !$Author: joelevin $ !$Date: 2011-03-24 11:33:26 -0500 (Thu, 24 Mar 2011) $ !$Revision: 11724 $ !$HeadURL: https://eweru-dev1.eweru.ksu.edu/svn/code/weps1/branches/WEPS_F90_update/weps.src/src/lib_erosion/erodinit.for $ !********************************************************************** subroutine erodinit use i_p1werm use i_m1flag use i_m1geo use i_m1subr use i_m2geo use i_e2grid use i_threshold use i_s1surf use s_sbbr use s_sbgrid use s_sbigrd implicit none !*--ERODINIT25 ! !*** Start of declarations rewritten by SPAG ! ! Local variables ! integer :: i,j,sr ! !*** End of declarations rewritten by SPAG ! ! ! +++ PURPOSE +++ ! ! Controls calls to subroutines that: ! create the Erosion submodel grid (sbgrid) ! initialize Erosion submodel output array to zero (sbigrd). ! calculate normalized effect of hills on friction velocity ! on grid for each wind direction (not activated) ! calculate normalized effect of barriers on friction velocity ! on grid for each wind direction (sbbr) ! initialize reporting variables that need to have a value even ! when erosion is not being called. ! + + + GLOBAL COMMON BLOCKS + + + ! ! +++ SUBROUTINES CALLED +++ ! sbgrid ! sbigrd ! sbhill (not activated) ! sbbr ! +++ LOCAL VARIABLES +++ ! + + + LOCAL VARIABLE DEFINITIONS + + + ! nbr = number of barriers (from m1geo.inc) ! +++ END SPECIFICATIONS +++ ! Grid is created at least once. if (am0eif.EQV..TRUE.) then !needed for initialization of csr(*,*) ! check to see if grid dimensions specified via cmdline args if ((xgdpt>0).AND.(ygdpt>0)) then imax = xgdpt + 1 jmax = ygdpt + 1 ix = (amxsim(1,2)-amxsim(1,1))/xgdpt jy = (amxsim(2,2)-amxsim(2,1))/ygdpt !code lifted from sbgrid because it is initialized there - LEW do j = 0,jmax do i = 0,imax csr(i,j) = 1 ! icsr = 1 end do end do else !use Hagen's grid dimensioning as the default call sbgrid end if ! set grid cell output arrays to zero call sbigrd ! check for hills - sbhill not implemented ! if (nhill .gt. 0) then ! call sbhill ! endif ! check for barriers if (nbr>0) call sbbr ! Turn off grid creation flag am0eif = .FALSE. end if do sr = 1,nsubr ! initalize erosion threshold trigger variables ne_erosion(sr) = 0 ne_snowdepth(sr) = 0 ne_wus_anemom(sr) = 0 ne_wus_random(sr) = 0 ne_wus_ridge(sr) = 0 ne_wus_biodrag(sr) = 0 ne_wus(sr) = 0 ne_bare(sr) = 0 ne_flat_cov(sr) = 0 ne_surf_wet(sr) = 0 ne_ag_den(sr) = 0 ne_wust(sr) = 0 ne_sfd84(sr) = 0 ne_asvroc(sr) = 0 ne_wzzo(sr) = 0 ne_sfcv(sr) = 0 ! initialize surface condition reporting values acanag(sr) = 0 acancr(sr) = 0 end do end subroutine erodinit