C ************************** C * PDE2D 9.2 MAIN PROGRAM * C ************************** C *** 1D PROBLEM SOLVED (COLLOCATION METHOD) *** C############################################################################## C Is double precision mode to be used? Double precision is recommended # C on 32-bit computers. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If double precision mode is used, variables and functions assigned +# C + names beginning with a letter in the range A-H or O-Z will be DOUBLE +# C + PRECISION, and you should use double precision constants and FORTRAN +# C + expressions throughout; otherwise such variables and functions will +# C + be of type REAL. In either case, variables and functions assigned +# C + names beginning with I,J,K,L,M or N will be of INTEGER type. +# C + +# C + It is possible to convert a single precision PDE2D program to double +# C + precision after it has been created, using an editor. Just change +# C + all occurrences of "real" to "double precision" +# C + " tdp" to "dtdp" (note leading blank) +# C + Any user-written code or routines must be converted "by hand", of +# C + course. To convert from double to single, reverse the changes. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## implicit double precision (a-h,o-z) parameter (neqnmx= 99) C############################################################################## C NXGRID = number of X-grid lines # C############################################################################## C-----------------------------------------> INPUT FROM GUI <------------------- PARAMETER (NXGRID = 10) C############################################################################## C How many differential equations (NEQN) are there in your problem? # C############################################################################## PARAMETER (NEQN = 2) C DIMENSIONS OF WORK ARRAYS C SET TO 1 FOR AUTOMATIC ALLOCATION PARAMETER (IRWK8Z= 1) PARAMETER (IIWK8Z= 1) PARAMETER (NXP8Z=1001,KDEG8Z=1) C############################################################################## C The solution is saved on a uniform grid of NX+1 points # C XA + I*(XB-XA)/NX # C I=0,...,NX. Enter a value for NX (suggested value = 50). # C # C############################################################################## PARAMETER (NX = 50) PARAMETER (NSAVE = 1) common/parm8z/ pi,D ,RL ,Q dimension xgrid(nxgrid),xout8z(0:nx),xcross(100),tout8z(0:nsave),u &out8z(0:nx,2*neqn,0:nsave),uout(0:nx,2,neqn,0:nsave),xres8z(nxp8z) &,ures8z(neqn,nxp8z) equivalence (uout,uout8z) allocatable iwrk8z(:),rwrk8z(:) C dimension iwrk8z(iiwk8z),rwrk8z(irwk8z) character*40 title logical linear,crankn,noupdt,nodist,fillin,evcmpx,adapt,plot,lsqfi &t,fdiff,econ8z,ncon8z,restrt,gridid common/dtdp14/ sint8z(20),bint8z(20),slim8z(20),blim8z(20) common/dtdp15/ evlr8z,ev0r,evli8z,ev0i,evcmpx common/dtdp16/ p8z,evr8z(50),evi8z(50) common/dtdp19/ toler(neqnmx),adapt common/dtdp30/ econ8z,ncon8z common/dtdp42/ nxa8z,kd8z common/dtdp43/ work8z(nxp8z+3) common/dtdp45/ perdc(neqnmx) common/dtdp46/ eps8z,cgtl8z,npmx8z,itype common/dtdp62/ amin8z(2*neqnmx),amax8z(2*neqnmx) pi = 4.0*atan(1.d0) nxa8z = nxp8z kd8z = kdeg8z C############################################################################## C If you don't want to read the FINE PRINT, default NPROB. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If you want to solve several similar problems in the same run, set +# C + NPROB equal to the number of problems you want to solve. Then NPROB +# C + loops through the main program will be done, with IPROB=1,...,NPROB, +# C + and you can make the problem parameters vary with IPROB. NPROB +# C + defaults to 1. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## NPROB = 1 do 78755 iprob=1,nprob C############################################################################## C You may now define global parameters, which may be referenced in any # C of the "FORTRAN expressions" you input throughout the rest of this # C interactive session. You will be prompted alternately for parameter # C names and their values; enter a blank name when you are finished. # C # C Parameter names are valid FORTRAN variable names, starting in # C column 1. Thus each name consists of 1 to 6 alphanumeric characters, # C the first of which must be a letter. If the first letter is in the # C range I-N, the parameter must be an integer. # C # C Parameter values are either FORTRAN constants or FORTRAN expressions # C involving only constants and global parameters defined on earlier # C lines. They may also be functions of the problem number IPROB, if # C you are solving several similar problems in one run (NPROB > 1). Note # C that you are defining global CONSTANTS, not functions; e.g., parameter # C values may not reference any of the independent or dependent variables # C of your problem. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If you define other parameters here later, using an editor, you must +# C + add them to COMMON block /PARM8Z/ everywhere this block appears, if +# C + they are to be "global" parameters. +# C + +# C + The variable PI is already included as a global parameter, with an +# C + accurate value 3.14159... +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C-----------------------------------------> INPUT FROM GUI <------------------- D = & 10 RL = & 2.5 Q = & -1 C############################################################################## C A collocation finite element method is used, with cubic Hermite # C basis functions on the subintervals defined by the grid points: # C XGRID(1),XGRID(2),...,XGRID(NXGRID) # C You will first be prompted for NXGRID, the number of X-grid points, # C then for XGRID(1),...,XGRID(NXGRID). Any points defaulted will be # C uniformly spaced between the points you define; the first and last # C points cannot be defaulted. The interval over which the PDE system # C is to be solved is then: # C XGRID(1) < X < XGRID(NXGRID) # C # C############################################################################## call dtdpwx(xgrid,nxgrid,0) C XGRID DEFINED C-----------------------------------------> INPUT FROM GUI <------------------- XGRID(1) = & 0 C-----------------------------------------> INPUT FROM GUI <------------------- XGRID(NXGRID) = & RL call dtdpwx(xgrid,nxgrid,1) C *******STEADY-STATE PROBLEM itype = 1 t0 = 0.0 dt = 1.0 crankn = .false. noupdt = .false. C############################################################################## C Is this a linear problem? ("linear" means all differential equations # C and all boundary conditions are linear) # C############################################################################## LINEAR = .TRUE. C Number of Newton iterations NSTEPS = 1 FDIFF = .FALSE. C############################################################################## C You may calculate one or more integrals (over the entire region) of # C some functions of the solution and its derivatives. How many integrals # C (NINT), if any, do you want to calculate? # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + In the FORTRAN program created by the preprocessor, the computed +# C + values of the integrals will be returned in the vector SINT8Z. If +# C + several iterations or time steps are done, only the last computed +# C + values are saved in SINT8Z (all values are printed). +# C + +# C + A limiting value, SLIM8Z(I), for the I-th integral can be set +# C + below in the main program. The computations will then stop +# C + gracefully whenever SINT8Z(I) > SLIM8Z(I), for any I=1...NINT. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C-----------------------------------------> INPUT FROM GUI <------------------- NINT = 1 C############################################################################## C You may calculate one or more boundary integrals (over the entire # C boundary) of some functions of the solution and its derivatives. How # C many boundary integrals (NBINT), if any, do you want to calculate? # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + In the FORTRAN program created by the preprocessor, the computed +# C + values of the integrals will be returned in the vector BINT8Z. If +# C + several iterations or time steps are done, only the last computed +# C + values are saved in BINT8Z (all values are printed). +# C + +# C + A limiting value, BLIM8Z(I), for the I-th boundary integral can be +# C + set below in the main program. The computations will then stop +# C + gracefully whenever BINT8Z(I) > BLIM8Z(I), for any I=1...NBINT. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## NBINT = 0 lsqfit = .false. RESTRT = .FALSE. GRIDID = .TRUE. C############################################################################## C If you do not have periodic boundary conditions, enter IPERDC=0. # C # C Enter IPERDC=1 for periodic conditions at X = XGRID(1),XGRID(NXGRID) # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + When periodic boundary conditions are selected, they apply to all +# C + variables by default. To turn off periodic boundary conditions on +# C + the I-th variable, set PERDC(I) to 0 below in the main program and +# C + set the desired boundary conditions in subroutine GB8Z, "by hand". +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C-----------------------------------------> INPUT FROM GUI <------------------- IPERDC = 0 C############################################################################## C The solution is saved on a uniform grid of NX+1 points, covering the # C interval (XA,XB). Enter values for XA,XB. These variables are usually # C defaulted. # C # C The defaults are XA = XGRID(1), XB = XGRID(NXGRID) # C # C############################################################################## C defaults for xa,xb xa = xgrid(1) xb = xgrid(nxgrid) C DEFINE XA,XB HERE: call dtdpx1(nx,xa,xb,hx8z,xout8z,npts8z) C SOLUTION SAVED EVERY NOUT ITERATIONS NOUT = NSTEPS C *******allocate workspace call dtdp1q(nxgrid,neqn,ii8z,ir8z) if (iiwk8z.gt.1) ii8z = iiwk8z if (irwk8z.gt.1) ir8z = irwk8z allocate (iwrk8z(ii8z),rwrk8z(ir8z)) C *******DRAW GRID POINTS? PLOT = .FALSE. C *******call pde solver call dtdp1x(xgrid, nxgrid, neqn, nint, nbint, xout8z, uout, tout8z &, iperdc, plot, lsqfit, fdiff, npts8z, t0, dt, nsteps, nout, nsave &, crankn, noupdt, itype, linear, rwrk8z, ir8z, iwrk8z, ii8z, restr &t, gridid) deallocate (iwrk8z,rwrk8z) C *******read from restart file to array ures8z C call dtdpr1(1,xres8z,nxp8z,ures8z,neqn) C *******write array ures8z back to restart file C call dtdpr1(2,xres8z,nxp8z,ures8z,neqn) C *******call user-written postprocessor call postpr(tout8z,nsave,xout8z,nx,uout,neqn) C *******LINE PLOTS C############################################################################## C Enter a value for IVAR, to select the variable to be plotted or # C printed: # C IVAR = 1 means U (possibly as modified by UPRINT,..) # C 2 Ux # C 3 RM # C 4 RMx # C############################################################################## IVAR = 1 C X IS VARIABLE ics8z = 1 ISET1 = 1 ISET2 = NSAVE ISINC = 1 C alow = amin8z(ivar) ahigh = amax8z(ivar) C############################################################################## C Specify the range (UMIN,UMAX) for the dependent variable axis. UMIN # C and UMAX are often defaulted. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + By default, each plot will be scaled to just fit in the plot area. +# C + For a common scaling, you may want to set UMIN=ALOW, UMAX=AHIGH. +# C + ALOW and AHIGH are the minimum and maximum values over all output +# C + points and over all saved time steps or iterations. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## UMIN = 0.0 UMAX = 0.0 C############################################################################## C Enter a title, WITHOUT quotation marks. A maximum of 40 characters # C are allowed. The default is no title. # C############################################################################## TITLE = ' ' TITLE = 'BEAM PROBLEM ' call dtdprx(tout8z,nsave,iset1,iset2,isinc) do 78756 is8z=iset1,iset2,isinc call dtdpzp(ics8z,ivar,tout8z,nsave,xout8z,nx,uout8z,neqn,title,um &in,umax,ix8z,is8z) 78756 continue C *******LINE PLOTS C############################################################################## C Enter a value for IVAR, to select the variable to be plotted or # C printed: # C IVAR = 1 means U (possibly as modified by UPRINT,..) # C 2 Ux # C 3 RM # C 4 RMx # C############################################################################## IVAR = 3 C X IS VARIABLE ics8z = 1 ISET1 = 1 ISET2 = NSAVE ISINC = 1 C alow = amin8z(ivar) ahigh = amax8z(ivar) C############################################################################## C Specify the range (UMIN,UMAX) for the dependent variable axis. UMIN # C and UMAX are often defaulted. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + By default, each plot will be scaled to just fit in the plot area. +# C + For a common scaling, you may want to set UMIN=ALOW, UMAX=AHIGH. +# C + ALOW and AHIGH are the minimum and maximum values over all output +# C + points and over all saved time steps or iterations. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## UMIN = 0.0 UMAX = 0.0 C############################################################################## C Enter a title, WITHOUT quotation marks. A maximum of 40 characters # C are allowed. The default is no title. # C############################################################################## TITLE = ' ' TITLE = 'RM ' call dtdprx(tout8z,nsave,iset1,iset2,isinc) do 78757 is8z=iset1,iset2,isinc call dtdpzp(ics8z,ivar,tout8z,nsave,xout8z,nx,uout8z,neqn,title,um &in,umax,ix8z,is8z) 78757 continue 78755 continue call endgks stop end subroutine pdes8z(yd8z,i8z,j8z,kint8z,x,t,uu8z) implicit double precision (a-h,o-z) parameter (neqnmx= 99) C un8z(1,I),un8z(2,I),... hold the (rarely used) values C of UI,UIx,... from the previous iteration or time step common /dtdp4x/un8z(3,neqnmx) common /dtdp11/normx double precision normx,uu8z(3,neqnmx) common/parm8z/ pi,D ,RL ,Q U = uu8z(1, 1) Ux = uu8z(2, 1) Uxx= uu8z(3, 1) RM = uu8z(1, 2) RMx = uu8z(2, 2) RMxx= uu8z(3, 2) if (i8z.eq.0) then yd8z = 0.0 C############################################################################## C Enter FORTRAN expressions for the functions whose integrals are to be # C calculated and printed. They may be functions of # C # C X,U,Ux,Uxx,RM,RMx,RMxx and (if applicable) T # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If you only want to integrate a function over part of the interval, +# C + define that function to be zero on the rest of the interval. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C INTEGRAL1 DEFINED Utrue = Q/D*(x**4/24 - RL*x**3/6 + RL**2*x**2/4) if (kint8z.eq.1) yd8z = & abs(U-Utrue) C############################################################################## C Enter FORTRAN expressions for the functions whose "integrals" (sum # C over two boundary points) are to be calculated and printed. They may # C be functions of # C # C X,U,Ux,Uxx,RM,RMx,RMxx and (if applicable) T # C # C The unit outward normal, NORMx (=1 at right endpoint, -1 at left), # C may also be referenced. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If you only want to "integrate" a function over one boundary point, +# C + define that function to be zero at the other point. +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C BND. INTEGRAL1 DEFINED C if (kint8z.eq.-1) yd8z = C & [DEFAULT SELECTED, DEFINITION COMMENTED OUT] else C############################################################################## C Now enter FORTRAN expressions to define the PDE coefficients, which # C may be functions of # C # C X,U,Ux,Uxx,RM,RMx,RMxx # C # C and, in some cases, of the parameter T. # C # C Recall that the PDEs have the form # C # C F1 = 0 # C F2 = 0 # C # C############################################################################## if (j8z.eq.0) then yd8z = 0.0 C-----------------------------------------> INPUT FROM GUI <------------------- C F1 DEFINED if (i8z.eq. 1) yd8z = & RMxx - Q C-----------------------------------------> INPUT FROM GUI <------------------- C F2 DEFINED if (i8z.eq. 2) yd8z = & Uxx - RM/D else endif endif return end function u8z(i8z,x,t0) implicit double precision (a-h,o-z) common/parm8z/ pi,D ,RL ,Q u8z = 0.0 return end subroutine gb8z(gd8z,ifac8z,i8z,j8z,x,t,uu8z) implicit double precision (a-h,o-z) parameter (neqnmx= 99) dimension uu8z(3,neqnmx) C un8z(1,I),un8z(2,I),... hold the (rarely used) values C of UI,UIx,... from the previous iteration or time step common /dtdp4x/ un8z(3,neqnmx) double precision none common/parm8z/ pi,D ,RL ,Q none = dtdplx(2) U = uu8z(1, 1) Ux = uu8z(2, 1) RM = uu8z(1, 2) RMx = uu8z(2, 2) if (j8z.eq.0) gd8z = 0.0 C############################################################################## C Enter FORTRAN expressions to define the boundary condition functions, # C which may be functions of # C # C X,U,Ux,RM,RMx and (if applicable) T # C # C Recall that the boundary conditions have the form # C # C G1 = 0 # C G2 = 0 # C # C Enter NONE to indicate "no" boundary condition. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + If "no" boundary condition is specified, the corresponding PDE is +# C + enforced at a point just inside the boundary (exactly on the +# C + boundary, if EPS8Z is set to 0 in the main program). +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## if (ifac8z.eq. 1) then C############################################################################## C # C First define the boundary conditions at the point X = XGRID(1). # C############################################################################## if (j8z.eq.0) then C-----------------------------------------> INPUT FROM GUI <------------------- C G1 DEFINED if (i8z.eq. 1) gd8z = & U C-----------------------------------------> INPUT FROM GUI <------------------- C G2 DEFINED if (i8z.eq. 2) gd8z = & Ux else endif endif if (ifac8z.eq. 2) then C############################################################################## C # C Now define the boundary conditions at the point X = XGRID(NXGRID). # C############################################################################## if (j8z.eq.0) then C-----------------------------------------> INPUT FROM GUI <------------------- C G1 DEFINED if (i8z.eq. 1) gd8z = & RM C-----------------------------------------> INPUT FROM GUI <------------------- C G2 DEFINED if (i8z.eq. 2) gd8z = & RMx else endif endif return end subroutine pmod8z(x,t,uu8z,uprint,uxprnt) implicit double precision (a-h,o-z) dimension uu8z(3,*),uprint(*),uxprnt(*) common/dtdp14/sint(20),bint(20),slim8z(20),blim8z(20) common/parm8z/ pi,D ,RL ,Q U = uu8z(1, 1) Ux = uu8z(2, 1) Uxx= uu8z(3, 1) RM = uu8z(1, 2) RMx = uu8z(2, 2) RMxx= uu8z(3, 2) C############################################################################## C If you don't want to read the FINE PRINT, default all of the following # C variables. # C # C +++++++++++++++ THE "FINE PRINT" (CAN USUALLY BE IGNORED) ++++++++++++++# C + Normally, PDE2D saves the values of U,Ux,RM,RMx at the output +# C + points. If different variables are to be saved (for later printing +# C + or plotting) the following functions can be used to re-define the +# C + output variables: +# C + define UPRINT(1) to replace U +# C + UXPRNT(1) Ux +# C + UPRINT(2) RM +# C + UXPRNT(2) RMx +# C + Each function may be a function of +# C + +# C + X,U,Ux,Uxx,RM,RMx,RMxx and (if applicable) T +# C + +# C + Each may also be a function of the integral estimates SINT(1),..., +# C + BINT(1),... +# C + +# C + The default for each variable is no change, for example, UPRINT(1) +# C + defaults to U. Enter FORTRAN expressions for each of the +# C + following functions (or default). +# C ++++++++++++++++++++++++++ END OF "FINE PRINT" +++++++++++++++++++++++++# C############################################################################## C DEFINE UPRINT(*),UXPRNT(*) HERE: return end C dummy routines subroutine xy8z(i8z,iarc8z,s,x,y,s0,sf) implicit double precision (a-h,o-z) return end subroutine dis8z(x,y,ktri,triden,shape) implicit double precision (a-h,o-z) return end function fb8z(i8z,iarc8z,ktri,s,x,y,t) implicit double precision (a-h,o-z) fb8z = 0 return end function axis8z(i8z,x,y,z,ical8z) implicit double precision (a-h,o-z) axis8z = 0 return end subroutine tran8z(itrans,x,y,z) implicit double precision (a-h,o-z) return end subroutine postpr(tout,nsave,xout,nx,uout,neqn) implicit double precision (a-h,o-z) dimension xout(0:nx),tout(0:nsave) dimension uout(0:nx,2,neqn,0:nsave) common/parm8z/ pi,D ,RL ,Q common /dtdp27/ itask,npes,icomm common /dtdp46/ eps8z,cgtl8z,npmx8z,itype data lun,lud/0,47/ if (itask.gt.0) return C UOUT(I,IDER,IEQ,L) = U-sub-IEQ, if IDER=1 C Ux-sub-IEQ, if IDER=2 C (possibly as modified by UPRINT,..) C at the point XOUT(I) C at time/iteration TOUT(L). C ******* ADD POSTPROCESSING CODE HERE: C IN THE EXAMPLE BELOW, MATLAB PLOTFILES pde2d.m, C pde2d.rdm CREATED (REMOVE C! COMMENTS TO ACTIVATE) C! if (lun.eq.0) then C! lun = 46 C! open (lun,file='pde2d.m') C! open (lud,file='pde2d.rdm') C! endif C! do 78753 l=0,nsave C! if (tout(l).ne.dtdplx(2)) nsave0 = l C!78753 continue C! write (lud,78754) nsave0 C! write (lud,78754) neqn C! write (lud,78754) nx C!78754 format (i8) C! do 78755 i=0,nx C! write (lud,78760) xout(i) C!78755 continue C! do 78759 l=0,nsave0 C! write (lud,78760) tout(l) C! do 78758 ieq=1,neqn C! do 78757 ider=1,2 C! do 78756 i=0,nx C! write (lud,78760) uout(i,ider,ieq,l) C!78756 continue C!78757 continue C!78758 continue C!78759 continue C!78760 format (e16.8) C! write (lun,*) '% Read solution from pde2d.rdm' C! write (lun,*) 'fid = fopen(''pde2d.rdm'');' C! write (lun,*) 'NSAVE = fscanf(fid,''%g'',1);' C! write (lun,*) 'NEQN = fscanf(fid,''%g'',1);' C! write (lun,*) 'NX = fscanf(fid,''%g'',1);' C! if (itype.eq.2) then C! write (lun,*) 'L0 = 0;' C! else C! write (lun,*) 'L0 = 1;' C! endif C! write (lun,*) 'T = zeros(NSAVE+1,1);' C! write (lun,*) 'X = zeros(NX+1,1);' C! write (lun,*) 'U = zeros(NX+1,NSAVE+1,2,NEQN);' C! write (lun,*) 'for i=0:NX' C! write (lun,*) ' X(i+1) = fscanf(fid,''%g'',1);' C! write (lun,*) 'end' C! write (lun,*) 'for l=0:NSAVE' C! write (lun,*) 'T(l+1) = fscanf(fid,''%g'',1);' C! write (lun,*) 'for ieq=1:NEQN' C! write (lun,*) 'for ider=1:2' C! write (lun,*) 'for i=0:NX' C! write (lun,*) C! & ' U(i+1,l+1,ider,ieq) = fscanf(fid,''%g'',1);' C! write (lun,*) 'end' C! write (lun,*) 'end' C! write (lun,*) 'end' C! write (lun,*) 'end' C! write (lun,*) 'xmin = min(X(:));' C! write (lun,*) 'xmax = max(X(:));' C! write (lun,*) '% Plots of each variable' C! write (lun,*) 'for IEQ=1:NEQN' C! write (lun,*) 'IDER = 1;' C! write (lun,*) 'umin = min(min(U(:,L0+1:NSAVE+1,IDER,IEQ)));' C! write (lun,*) 'umax = max(max(U(:,L0+1:NSAVE+1,IDER,IEQ)));' C! write (lun,*) 'for L=L0:NSAVE' C! write (lun,*) ' figure' C! write (lun,*) ' plot(X,U(:,L+1,IDER,IEQ))' C! write (lun,*) ' axis([xmin xmax umin umax])' C! write (lun,*) ' xlabel(''X'')' C! write (lun,*) ' ylabel([''U'',num2str(IEQ)])' C! write (lun,*) ' title(['' T = '',num2str(T(L+1))])' C! write (lun,*) 'end' C! write (lun,*) 'end' return end