diff --git a/src/create_surfaces.f90 b/src/create_surfaces.f90 index 7be73cb4df22cc53e43a2ab4b43a2cf6c1da570d..1fc267d5e6206aa9d1fe47f56f1c4f289745065e 100644 --- a/src/create_surfaces.f90 +++ b/src/create_surfaces.f90 @@ -161,6 +161,7 @@ else ! type 9 : cosinus sinus ! type 10 : slope ! type 11 : 2D hill + ! type 12 : rectangular emboss with specified slope select case(surface_type) @@ -483,12 +484,11 @@ double precision sp01,sp02,sp03,sp04,sp05,sp06,sp07,sp08,sp09,sp10 !------------------------------------------------------------------------------| integer i -double precision delta,dist,ran +double precision delta,dist,ran,m,pi,x1a,x1b,x2a,x2b,y1a,y1b,y2a,y2b,zx !------------------------------------------------------------------------------| !------------------------------------------------------------------------------| - select case(surface_type) case (1) ! a flat surface, @@ -610,7 +610,47 @@ select case(surface_type) z(i)=sp01 end if end do - + case (12) + ! rectangular emboss with specified slope, + ! sp01 is the z level + ! sp02 and 03 are x1,x2 + ! sp04 and 05 are y1,y2 + ! sp06 is the thickness + ! sp07 is the slope + pi=atan(1.d0)*4.d0 + m=tan(sp07*pi/180.d0) + x1a=sp02+(sp06/(2.d0*m)) + x1b=sp02-(sp06/(2.d0*m)) + x2a=sp03+(sp06/(2.d0*m)) + x2b=sp03-(sp06/(2.d0*m)) + y1a=sp04+(sp06/(2.d0*m)) + y1b=sp04-(sp06/(2.d0*m)) + y2a=sp05+(sp06/(2.d0*m)) + y2b=sp05-(sp06/(2.d0*m)) + do i=1,ns + if (x(i).le.x1a) then + zx=sp01 + elseif (x(i).le.x1b) then + zx=sp01-((x(i)-x1a)/(sp06/m)*sp06) + elseif (x(i).le.x2a) then + zx=sp01-sp06 + elseif (x(i).le.x2b) then + zx=sp01-((1.d0-((x(i)-x2a)/(sp06/m)))*sp06) + else + zx=sp01 + endif + if (y(i).le.y1a) then + z(i)=sp01 + elseif (y(i).le.y1b) then + z(i)=min(sp01-((y(i)-y1a)/(sp06/m)*sp06),zx) + elseif (y(i).le.y2a) then + z(i)=min(sp01-sp06,zx) + elseif (y(i).le.y2b) then + z(i)=min(sp01-((1.d0-((y(i)-y2a)/(sp06/m)))*sp06),zx) + else + z(i)=sp01 + endif + end do case default call stop_run ('surface type not defined$')