double precision function u_exa(x,y,t,c_x,c_y) c General information: c Function u_exa returns an exact solution to the convection c equation: c c u_t + c_x ux + c_y u_y =0. c Function u_exa requires an arbitrary two parameter c double precision function f(x,y). c The returned exact solution will be: c f(x-c_x t, y - c_y t) c Arguments: c Avoid typos: implicit none c Input: the position for which to return the exact solution: double precision x,y c Input: the time at which to return the exact solution: double precision t c Input: the components c_x and c_y of the convection velocity: double precision c_x,c_y c External variables: c An arbitrary two-parameter function: double precision f external f c Executable statements: c Return the exact solution: u_exa=f(x-c_x*t,y-c_y*t) c Exit: return end c ======================================================================== c ======================================================================== double precision function f(x,y) c General information: c Function f is an infinitely smooth, bounded, periodic but c not harmonic function of two arguments. c Arguments: c Avoid typos: implicit none c The two arguments of f: double precision x,y c Local variables: c Parameters of the function double precision c1,c2 parameter (c1=2.3d0,c2=1.5d0) c Executable statements: c Return the value of f: f=sin(sin(c1*x-y))*cos(c2*cos(x+y)) c Exit: return end