c c subroutine orient o (rh,rw,rs,rd,dh,ds, i impl_rh,impl_rw,impl_rs,impl_rd, i impl_dh,impl_ds,tilld,rflag) c + + + PURPOSE + + + c c This subroutine performs an oriented roughness calculation c after a tillage operation. Actually it performs a check of the c ridge flag (rflag) and does the coresponding manipulation c of the ridge parameters. The three valid values of the c ridge flag are: c 0 - operation has no effect if a ridge currently exists. c 1 - set all oriented roughness parameters to the implement values. c 2 - Modification depends on the current ridge height, c specified tillage depth, and ridging characteristics c of the tillage implement. c If the tillage depth is great enough to remove the ridges, c ridge values are set according to the implement values. c If the tillage depth is too shallow to remove the current c ridges alone, then the two following situations occur: c a) if the difference between the original ridge height and c specified tillage depth is less than the implement specified c ridging height, the ridge values are set according to the c implement values. c b) if not, then the current ridge remains but at a reduced c height dependent upon the implement tillage depth. c c + + + KEYWORDS + + + c oriented roughness (OR), tillage (primary/secondary) c c + + + ARGUMENT DECLARATIONS + + + c c + + + ARGUMENT DEFINITIONS + + + c c + + + ACCESSED COMMON BLOCK VARIABLE DEFINITIONS + + + c c + + + PARAMETERS + + + c c + + + LOCAL VARIABLES + + + c real rh,rw,rs,rd,dh,ds real impl_rh,impl_rw,impl_rs,impl_rd real impl_dh,impl_ds real tilld integer rflag c c + + + LOCAL VARIABLE DEFINITIONS + + + c c rh - current ridge height (mm) c rw - current ridge width (mm) c rs - current ridge spacing (mm) c rd - current ridge direction (clockwise from true north) c rh - current dike height (mm) c rs - current dike spacing (mm) c impl_rh - implement ridge height (mm) c impl_rw - implement ridge width (mm) c impl_rs - implement ridge spacing (mm) c impl_rd - implement ridge direction (clockwise from true north) c impl_dh - implement dike height (mm) c impl_ds - implement dike spacing (mm) c tilld - implement tillage depth (mm) c rflag - flag (0-2) telling what needs to be done c + + + END SPECIFICATIONS + + + c c Perform the calculation of the oriented OR after a tillage c operation. c select case (rflag) case (0) !typical of a row cultivator in a ridged field if (rh .lt. 0.1) then !if ridges don't exist, create'em rh = impl_rh rw = impl_rw rs = impl_rs rd = impl_rd dh = impl_dh ds = impl_ds else !don't disturb ridges if they exist in field endif case (1) !always set ridge values to those specified for tool rh = impl_rh rw = impl_rw rs = impl_rs rd = impl_rd dh = impl_dh ds = impl_ds case (2) !adjust ridge height based upon tillage depth if (tilld .ge. (rh/2.0)) then !tillage depth is deep enough rh = impl_rh rw = impl_rw rs = impl_rs rd = impl_rd dh = impl_dh ds = impl_ds else if (impl_rh .ge. (2.0 * (rh/2.0 - tilld))) then !tillage implement ridging great enough rh = impl_rh rw = impl_rw rs = impl_rs rd = impl_rd dh = impl_dh ds = impl_ds else !tdepth too shallow to completely remove original ridges rh = 2.0 * (rh/2.0 - tilld) dh = impl_dh ds = impl_ds endif endif case default print *, 'The ridge flag (for oriented roughness)' print *, ' was not set correctly' end select return end