GROUP 1. Run title and other preliminaries
text(Flow In Lake After Wind Stops 
#cls
TITLE
  DISPLAY
  
  
  It is supposed that a prolonged steady wind has created
  a uniform gradient in the surface level of a lake.
  
  When the wind suddenly ceases, the water level
  returns to horizontality, after oscillating a number
  of times which depends upon the lake-bed friction, but
  which is also influenced by "numerical diffusion"
  resulting from the limited number of time steps and
  space intervals employed.
  
  The pressure-dependent-porosity method is used.
  
  Setting idispa = 2 dumps field data to parphi at 
  every second time step.
  
  PHOTON USE commands facilitate viewing.
  
  
  ENDDIS
#pause
  PHOTON USE
  p
  parphi
  1 1 0.8 
 
  up z
  vi -y
  gr ou y 1

  con p1 y 1 fi;0.001
  msg vertical dimension is time, horizontal is distance
  msg contours of pressure
  pause;con off;cl
  con u1 y 1 fi;0.001
  msg vertical dimension is time, horizontal is distance
  msg contours of velocity
  ENDUSE
  -------------------------------------------------------------------------
    GROUP 2. Transience; time-step specification
STEADY=F;GRDPWR(T,100,1000.0,1.0)
 
    GROUP 3. X-direction grid specification
  ** A one-dimensional analysis is used; the lake is supposed
  to be 1500 meters wide in the wind direction
GRDPWR(X,50,1500.0,1.0)
 
    GROUP 4. Y-direction grid specification
YVLAST=500.0
 
    GROUP 5. Z-direction grid specification
ZWLAST=16.0
 
    GROUP 6. Body-fitted coordinates or grid distortion
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1);STORE(EPOR,VPOR)
 
    GROUP 9. Properties of the medium (or media)
RHO1=1000.0
  **The following statements activate sequences in group 19
    section 3 of GREX3 which make both the volume and east-
    face porosities linearly dependent on the pressure at iz=1.
    For the east cell faces:
      porosity= poria + porib * pressure,
    where porib = 1/(g*rho*z) by hydrostatics.
REAL(BBB);BBB=1./(9.81*RHO1*ZWLAST)
IPORIA=1;PORIA=1.0;PORIB=BBB;
  **The dependence of the logarithm of the cell volume on
    pressure is represented by the next statement, in order
    to accelerate convergence. Note that:
        d(rho*vol/dt)/dp = (rho*vol/dt)*d(ln vol)/dp
DRH1DP=BBB
 
    GROUP 10. Inter-phase-transfer processes and properties
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=0.0;FIINIT(U1)=0.0;FIINIT(EPOR)=1.0;FIINIT(VPOR)=1.0
INIADD=F
PATCH(PINIT,LINVLX,1,NX,1,1,1,2,1,1);INIT(PINIT,P1,1.0,-750.0)
 
    GROUP 13. Boundary conditions and special sources
  ** lake-bed friction
PATCH(LAKE-BED,LOW,1,NX,1,1,1,1,1,1)
COVAL(LAKE-BED,U1,0.001,0.0)
 
    GROUP 14. Downstream pressure for PARAB=.TRUE.
    GROUP 15. Termination of sweeps
LSWEEP=5
SPEDAT(SET,GXMONI,TRANSIENT,L,F) 
    GROUP 21. Print-out of variables
OUTPUT(P1,Y,N,N,N,N,N);OUTPUT(U1,Y,N,N,N,N,N)
OUTPUT(EPOR,Y,N,N,N,N,N);OUTPUT(VPOR,Y,N,N,N,N,N)
NTPRIN=LSTEP/5
 
    GROUP 22. Spot-value print-out
ITABL=1;IXMON=NX/2
 
    GROUP 23. Field print-out and plot control
NXPRIN=NX/5
PATCH(WAVE,PROFIL,1,NX,1,1,1,1,1,LSTEP)
PLOT(WAVE,U1,0.0,0.0);PLOT(WAVE,P1,0.0,0.0)
PATCH(HALFWAY,PROFIL,NX/2,NX/2,1,1,1,1,1,LSTEP)
PLOT(HALFWAY,U1,0.0,0.0);PLOT(HALFWAY,P1,0.0,0.0)
 LIBREF  =     472
idispa=2