!*==saeinp.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/saeinp.for $ subroutine saeinp use i_p1werm use i_p1const use i_b1glob use i_c1glob use i_d1glob use i_m1geo use i_w1wind use i_w1pavg use i_s1dbh use i_s1layr use i_s1phys use i_s1agg use i_s1surf use i_s1sgeo use i_h1db1 use i_m1flag use i_m1sim use i_m1subr use i_wpath use i_c1gen use i_e2grid use i_e3grid use i_m2geo use i_s2sgeo use i_s2agg use i_s2surf use s_caldat use s_fopenk implicit none !*--SAEINP43 ! !*** Start of declarations rewritten by SPAG ! ! Local variables ! integer :: b,day,k,l,mon,yr ! !*** End of declarations rewritten by SPAG ! ! ! +++ PURPOSE +++ ! print out input file for stand alone erosion ! ! +++ ARGUMENT DECLARATIONS +++ ! +++ ARGUMENT DEFINITIONS +++ ! ! +++ PARAMETER +++ ! ! + + + GLOBAL COMMON BLOCKS + + + ! ! + + + LOCAL COMMON BLOCKS + + + ! include 'erosion/w2wind.inc' ! ! +++ LOCAL VARIABLES +++ ! ! + + + LOCAL VARIABLE DEFINITIONS + + + ! ! +++ SUBROUTINES CALLED +++ ! ! +++ FUNCTION DECLARATIONS +++ ! ! +++ END SPECIFICATIONS +++ ! call fopenk(42,rootp(1:len_trim(rootp))//'saeros.in','unknown') call caldat(am0jd,day,mon,yr) write (42,1000) day,mon,yr 1000 format ('# day mon yr',2(1x,i2),2x,i4) ! print header info write (42,1100) 1100 format ('#',65('*'),/,'# file: erod.in',/,'#',65('*'),/, & & &'#',/,&'# +++ PURPOSE +++',/,&'#',/,& & &'# Input file which is read by stand alone erosion model'& & ,/,&'#',/,&'# +++ DEFINITIONS +++',/,&'#',/, & &&'# Lines beginning with a "#" character are comments',/,& & &'#',/,&'# * = inputs NOT presently used by erosion',/, & &&'#',/, & &&'# All other input values must be correctly specified.',& & /,&'#',/,& & &'# Comments prior to each line of data have the following for&& & mat& &',/,&'#',/, & &&'# Variable_Name, Var_type, (inc file) Text Definition',/, & &&'#',/, & &&'# where Var_type is: I = integer, L = logical, R = real',/, & &&'#',/,&'# +++ DEBUG FLAG +++',/,&'#',/,& & &'# debugflg - debug flag for providing different levels of de&& & bug& & output',/, & &&'# value of 0 will print no debug output',/,& & &'# value of 1 will print out and number all input && & li& &nes',/,& & &'# value of 2 will print out and number all data i&& & npu& &t lines',/,& & &'# value of 3 will do both 1 and 2 input line debu&& & g o& &utput') write (42,*) '0' write (42,1200) 1200 format (&'#',/,&'# +++ INITIALIZATIONS +++',/,&'#',/,& & &'# am0eif, L, (m1flag.inc) EROSION initialization flag'& & ) write (42,*) '.TRUE.' write (42,1300) 1300 format ('# am0efl, L, (m1flag.inc) EROSION "print" flag') write (42,*) '1' write (42,1400) 1400 format ('#',/,&'# +++ SIMULATION REGION +++',/,&'#',/,& & &'# amxsim(x,y), R, (m1geo.inc) Simulation Region coordinates (& && m)& &',/, & &&'# Input x,y coordinates in this form: x1,y1 x2,y2'& & ) write (42,*) amxsim(1,1),amxsim(2,1),amxsim(1,2),amxsim(2,2) write (42,1500) 1500 format (&'#',/,& & &'# amxsim(x,y), R, (m1geo.inc) Simulation Region orientation a& && ng& &le',/,&'# clockwise with 0=north') write (42,*) amasim write (42,1600) 1600 format ('#',/,&'# +++ ACCOUNTING REGIONS +++',/,&'#',/,& & &'# nacctr, I, (m1geo.inc) Number of accounting regions (must be 1 & && fo& &r now)') write (42,*) nacctr write (42,1700) 1700 format ('#',/,& & &'# amxar(x,y,a), R, (m1geo.inc) Accounting Region coordinates & && (m& &)',/,& & &'# Input x,y coordinates in this form: x1,y1 & && x2& &,y2',/,& & &'# for each accounting region specified (nacct& && r)& &') write (42,*) amxar(1,1,nacctr),amxar(2,1,nacctr), & & &amxar(1,2,nacctr),amxar(2,2,nacctr) ! barriers write (42,1800) 1800 format ('#',/,&'# +++ BARRIERS +++',/,&'#',/, & &&'# nbr, I, (m1geo.inc) Number of barriers (0-5) ') write (42,*) nbr write (42,1900) 1900 format ('#',/,& & &'# NOTE: Remaining BARRIER inputs are repeated for each barrie& && r & &specified',/,& & &'# If no barriers specified (nbr=0), then no BARRIER inputs wi& && ll& & be here',/,&'#',/,& & &'# amxbr(x,y,b), R, (m1geo.inc) Accounting Region coordinates & && (m& &)',/, & &&'# Input x,y coordinates in this form: x1,y1 x2,y2', & & /,&'# for each barrier specified (nbr)',/, & &&'# 0.0, 0.0 0.0 100.0',/,&'#',/, & &&'# amzbr(b), R, (m1geo.inc) Barrier height (m)',/, & &&'# ampbr(b), R, (m1geo.inc) Barrier porosity (m^2/m^2)',/, & &&'# amxbrw(b), R, (m1geo.inc) Barrier width (m)',/, & &&'# 1.2 0.50 2.0',/,&'#') do b = 1,nbr write (42,2000) 2000 format ('# amxar(1,1,b), amxar(2,1), amxar(1,2),amxar(2,2)') write (42,*) amxbr(1,1,b),amxbr(2,1,b),amxbr(1,2,b), & & amxbr(2,2,b) write (42,2100) 2100 format ('#, amzbr(b), ampbr(b), amxbrw(b)') write (42,*) amzbr(b),ampbr(b),amxbrw(b) end do ! subregions write (42,2200) 2200 format ('#',/,&'# +++ SUBREGIONS +++',/,&'#',/, & &&'# nsubr, I, (m1subr.inc) Number of subregions (1-5)'& & ) write (42,*) nsubr write (42,2300) 2300 format ('#',/,& & &'# NOTE: Remaining SUBREGION inputs (BIOMASS, SOIL, and HYDROL& && OG& &Y,',/,& & &'# ie. variables defined by subregion) are repeated for nsubr & && ',& & /,&'# subregions specified',/,&'#',/, & &&'# amxsr(x,y,s), R, (m1subr.inc) Subregion coordinates (m)', & & /,&'# Input x,y coordinates in this form: x1,y1 x2,y2'& & ,/,&'# for each subregion specified (subr)') write (42,*) amxsr(1,1,1),amxsr(2,1,1),amxsr(1,2,1),amxsr(2,2,1) write (42,2400) 2400 format ('#',/,&'# +++ BIOMASS +++',/,&'#',/,& & &'# adzht_ave(s), R, (d1glob.inc) Average residue height (m)'& & ) write (42,*) adzht_ave(1) ! Changed above to use "average residue height" instead of "overall height" - LEW 1/26/06 ! &'# abzht(s), R, (b1glob.inc) Overall biomass height (m)') ! write(42,*) abzht(1) write (42,2500) 2500 format ('#',/,&'# aczht(s), R, (c1glob.inc) Crop height (m)'& & ) write (42,*) aczht(1) write (42,2600) 2600 format ('#',/,& & &'# acrsai(s), R, (c1glob.inc) Crop stem area index (m^2/m^2)& && ',& & /,& & &'# acrlai(s), R, (c1glob.inc) Crop leaf area index (m^2/m^2)& && ') write (42,*) acrsai(1),acrlai(1) write (42,2700) 2700 format ('#',/,& & &'# adrsaitot(s), R, (d1glob.inc) Residue stem area index (m^& && 2/& &m^2)',/,& & &'# adrlaitot(s), R, (d1glob.inc) Residue leaf area index (m^& && 2/& &m^2)') write (42,*) adrsaitot(1),adrlaitot(1) write (42,2800) 2800 format ('#',/,&'# acxrow(s) Crop row spacing (m)'&,/,& & &'# ac0rg(s) Crop seed placement (0 - furrow, 1 - ridge)'& & &) write (42,*) acxrow(1),ac0rg(1) write (42,2900) 2900 format ('#',/,&'# These are not implemented within EROSION',/,& & &'# abrsaz(h,s), R, (b1geom.inc) Biomass stem area index by h& && t & &(1/m)',/,&'# (should be 5 values here when used)',/,& & &'# abrlaz(h,s), R, (b1geom.inc) Biomass leaf area index by h& && t & &(1/m)',/,&'# (should be 5 values here when used)',/, & &&'#',/,&'# Only abffcv(s) is currently implemented within EROSION'& & ,/, & &&'# abffcv(s), R, (b1geom.inc) Flat biomass cover (m^2/m^2)'& & ,&/,& & &'# abfscv(s), R, (b1geom.inc) Standing biomass cover (m^2/m^& && 2)& &',/,& & &'# abftcv(s), R, (b1geom.inc) Total biomass cover (m^2/m^2)'& & &,/,& & &'# (should be 3 values here when abffcv(s) and abfscv(& && s)& & are used)') write (42,*) abffcv(1) ! soil write (42,3000) 3000 format ('#',/,&'# +++ SOIL +++',/,&'#',/,& & &'# nslay(s), I, (s1layr.inc) Number of soil layers (3-10)'& & ) write (42,*) nslay(1) write (42,3100) 3100 format ('#',/,& & &'# NOTE: Remaining SOIL inputs are repeated for each layer spe& && ci& &fied',/,&'#',/, & &&'# aszlyt(l,s), R, (s1layr.inc) Soil layer thickness (mm)') write (42,*) (aszlyt(l,1),l=1,nslay(1)) write (42,3200) 3200 format ('#',/,& & &'# asdblk(l,s), R, (s1phys.inc) Soil layer bulk density (Mg/m^& && 3'& & ) write (42,*) (asdblk(l,1),l=1,nslay(1)) write (42,3300) 3300 format ('#',/,& & &'# asfsan(l,s),R,(s1dbh.inc) Soil layer sand content (Mg/Mg)'& & ) write (42,*) (asfsan(l,1),l=1,nslay(1)) write (42,3400) 3400 format ('#',/,& & &'# asfvfs(l,s), R, (s1dbh.inc) Soil layer very fine sand (Mg/M& && g)& &') write (42,*) (asfvfs(l,1),l=1,nslay(1)) write (42,3500) 3500 format ('#',/,& & &'# asfsil(l,s),R,(s1dbh.inc) Soil layer silt content (Mg/Mg)'& & ) write (42,*) (asfsil(l,1),l=1,nslay(1)) write (42,3600) 3600 format ('#',/,& & &'# asfcla(l,s),R,(s1dbh.inc) Soil layer clay content (Mg/Mg)'& & ) write (42,*) (asfcla(l,1),l=1,nslay(1)) write (42,3700) 3700 format ('#',/,& & &'# asvroc(l,s), R, (s1dbh.inc) Soil layer rock volume (m^3/m^3& && )'& & ) write (42,*) (asvroc(l,1),l=1,nslay(1)) write (42,3800) 3800 format ('#',/,& & &'# asdagd(l,s),R,(s1agg.inc) Soil layer agg density (Mg/m^3)'& & ) write (42,*) (asdagd(l,1),l=1,nslay(1)) write (42,3900) 3900 format ('#',/,& & &'# aseags(l,s), R, (s1agg.inc) Soil layer agg stability ln(J/k& && g)& &') write (42,*) (aseags(l,1),l=1,nslay(1)) write (42,4000) 4000 format ('#',/, & &&'# aslagm(l,s), R, (s1agg.inc) Soil layer GMD (mm)') write (42,*) (aslagm(l,1),l=1,nslay(1)) write (42,4100) 4100 format ('#',/,& & &'# aslagn(l,s), R, (s1agg.inc) Soil layer minimum agg size (mm& && )'& & ) write (42,*) (aslagn(l,1),l=1,nslay(1)) write (42,4200) 4200 format ('#',/,& & &'# aslagx(l,s), R, (s1agg.inc) Soil layer maximum agg size (mm& && )'& & ) write (42,*) (aslagx(l,1),l=1,nslay(1)) write (42,4300) 4300 format ('#',/,& & &'# as0ags(l,s), R, (s1agg.inc) Soil layer GSD (mm/mm)'& & ) write (42,*) (as0ags(l,1),l=1,nslay(1)) write (42,4400) 4400 format ('#',/,& & &'# asfcr(s), R, (s1surf.inc) Surface crust fraction (m^2/m^2)'& & &,/, & &&'# aszcr(s), R, (s1surf.inc) Surface crust thickness (mm)',/,& & & & &'# asflos(s), R, (s1surf.inc) Fraction of loose material on su& && rf& &ace (m^2/m^2)',/,& & &'# asmlos(s), R, (s1surf.inc) Mass of loose material on crust & && (k& &g/m^2)',/, & &&'# asdcr(s), R, (s1surf.inc) Soil crust density (Mg/m^3)',/, & &&'# asecr(s), R, (s1surf.inc) Soil crust stability ln(J/kg)') write (42,*) asfcr(1),aszcr(1),asflos(1),asmlos(1),asdcr(1), & & &asecr(1) write (42,4500) 4500 format ('#',/,& & &'# aslrr(s), R, (s1sgeo.inc) Allmaras random roughness (mm)'& & ) write (42,*) aslrr(1) write (42,4600) 4600 format ('#',/, & &&'# aszrgh(s), R, (s1sgeo.inc) Ridge height (mm)',/, & &&'# asxrgs(s), R, (s1sgeo.inc) Ridge spacing (mm)',/, & &&'# asxrgw(s), R, (s1sgeo.inc) Ridge width (mm)',/,& & &'# asargo(s), R, (s1sgeo.inc) Ridge orientation (deg)'& & ) write (42,*) aszrgh(1),asxrgs(1),asxrgw(1),asargo(1) write (42,4700) 4700 format ('#',/, & &&'# asxdks(s), R, (s1sgeo.inc) Dike spacing (mm)') write (42,*) asxdks(1) write (42,4800) ! hydrology 4800 format ('#',/,&'# +++ HYDROLOGY +++',/,&'#',/, & &&'# ahzsnd(s), R, (s1sgeo.inc) Snow depth (mm)') write (42,*) ahzsnd(1) write (42,4900) 4900 format ('#',/,& & &'# ahrwcw(l,s), R, (h1db1.inc) Soil layer wilting point water & && co& &ntent (Mg/Mg)') write (42,*) (ahrwcw(l,1),l=1,nslay(1)) write (42,5000) 5000 format ('#',/,& & &'# ahrwca(l,s), R, (h1db1.inc) Soil layer water content (Mg/Mg& && )'& & ) write (42,*) (ahrwca(l,1),l=1,nslay(1)) write (42,5100) 5100 format ('#',/,& & &'# ahrwc0(h,s), R, (h1db1.inc) Surface layer water content (Mg& && /M& &g)',/,& & &'# NOTE: the near surface water content is specif& && ie& &d on an',/,& & &'# hourly basis. We read in the hrly water& && c& &ontent',/,& & &'# on two lines, with 12 values in each lin& && e.& &') write (42,5200) (ahrwc0(l,1),l=1,12) 5200 format (12(1x,f10.7)) write (42,5200) (ahrwc0(l,1),l=13,24) ! weather write (42,5300) 5300 format ('#',/, & &&'# NOTE: This is the end of the SUBREGION variables',/, & &&'#',/,&'# +++ WEATHER +++',/,&'#',/, & &&'# awdair, R, (w1pavg.inc) Air density (kg/m^3)') write (42,*) awdair write (42,5400) 5400 format ('#',/, & &&'# awadir, R, (w1wind.inc) Wind direction (deg)') write (42,*) awadir write (42,5500) 5500 format ('#',/,& & &'# ntstep, I, (local variable) Number of intervals/day to run & && ER& &OSION') write (42,*) ntstep write (42,5600) 5600 format ('#',/,&'# anemht, R anemometer height (m)',/,& & &'# awzzo, R aerodynamic roughness at anemometer site (mm)'& & ,&/,'# wzoflg, I (global variable) zo location flag',/, & &&'# (flag =0 - zo fixed at wx sta. location)',/, & &&'# (flag = 1 - zo variable at field location)') write (42,*) anemht,awzzo,wzoflg write (42,5700) 5700 format ('#',/,&'# wflg, I, (local variable) Wind/Weibull flag'& & ,/,& & &'# (0 - read in Weibull parameters, 1 - read in wind & && sp& &eeds)') write (42,*) '1' write (42,5800) 5800 format ('#',/, & &&'# NOTE: This is only present when the above (wflg=0)',/,& & & & &'# wfcalm, R, (local variable) Fraction of time winds are calm& && (& &hr/hr)',/, & &&'# wuc, R, (local variable) Weibull "c" factor (m/s)',/, & &&'# w0k, R, (local variable) Weibull "k" factor (fraction)',/,& & &'# 0.263 5.856 1.720',&'#',/, & &&'# NOTE: The remaining data is only present when (wflg=1)',/, & &&'# wflg=1 uses standard input from windgen in WEPS.',/, & & &'#',/,& & &'# awu(i), R, (w1wind) Wind speed for (ntstep) intervals (m/& && s)& &',/,'#',/,& & &'# I think I can read multiple lines with variable number of value& && s'& & ,/,&'# We will try and see - LEW Must use 6 values per line LH.',& & /,&'#') write (42,*) (awu(k),k=1,6) write (42,*) (awu(k),k=7,12) write (42,*) (awu(k),k=13,18) write (42,*) (awu(k),k=19,24) write (42,5900) 5900 format ('#',/,&'# + + + DATA TO PLOT + + +',/,&'#',/, & &&'# names and values to input for plot',/,& & &'# place 1 flag in 1st line after #-name line for variables& & & to inc& &lude in plot',/,&'#',/,& & &'# initial xplot value,I, (-1=no plot, 0 = plot indep.varia& & & bles wi& &th 1 flag)') write (42,*) '-1' ! end subroutine saeinp