MODULE domain implicit none save real :: XW,XE,YS,YN END MODULE domain PROGRAM contour90 USE domain implicit none ! ! READ ME ! ! your source code to generate the 2-d arrays goes between the ! first pair of lines that contain c repeated many times. To ! change the calls to the plot generation, make mods between ! the next pair of lines containing c repeated many times. ! ! run the program by: ! ncargf90 contour90.f ! ./a.out ! !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ! For this example, arrays PSIP and PSI are created. ! integer, PARAMETER :: NY=21,Nx=41 ! NY=GRID PTS IN Y, NX GRID PTS IN X, real :: Y(NY),X(NX),PSIP(NX,Ny),PSI(NX,Ny) real :: pi,g,cint integer :: i,j ! CHARACTER (len=8) :: CHRS PI=acos(-1.) eye : DO I=1,NX X(I)=FLOAT(I-1)*0.1-2. jay : DO J=1,NY Y(J)=FLOAT(J-1)*0.1-1. PSIP(I,J)=17.*EXP(-X(I)**2-Y(J)**2) PSI(I,J)=27.2*SIN(0.5*PI*X(I))*COS(PI*Y(J)/2.-X(I)/3.) end do jay end do eye ! ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc ! ! NOW PLOT PSIP and PSI ! ! start plot commands CALL OPNGKS g=1. ! input ranges, neg values may be needed due to constraints of the ! call to subroutine set in subroutine ploty (see note below) ! these ranges are also used to label axes. ! left & right edges of "x" range XW=X(1) XE=X(NX) ! bottom & top edges of "y" range YS=Y(1) YN=Y(NY) ! note: the set call requires: xwd