TALK=T;RUN( 1, 5)                                                  
                                                                    
  Echo DISPLAY / USE settings                                       
  DISPLAY                                                           
  The purpose of creation of this case is a demonstration           
  of the transfer objects feature.                                  
                                                                    
  This example explores the distribution of pollution on a          
  reasonablylarge region of ground. The use of transfer objects     
  permits the calculation of unidirectional flow on small parts,    
  one after another.                                                
                                                                    
  The solved area in this example is divided into four parts.       
  The solution in each part is made in a separate run.              
                                                                    
               ---------------------                                
               !         !         !                                
               !         !         !                                
               ! 3rd run ! 4th run !                                
               !         !         !                                
       W1      !         !         !                                
       -->     ----------+----------                                
               !         !         !                                
               !         !         !                                
               ! 1st run ! 2nd run !                                
               !         !         !                                
        X !    !         !         !                                
          !    ---------------------                                
          !              ^                                          
          !----- Z      /!\                                         
                         !                                          
                         !U1                                        
                                                                    
  HIGHTRO1
  and EASTTRO1 transfer objects on the high and
  east boundaries are formed at the end of the first run by means   
  of two '(export' In-Form statements.                              
                                                                    
  They store values of outlet mass flux and concentration on these  
  boundaries to transfer them to the second and third runs.         
                                                                    
  The second run reads the information at the low boundary from the 
  HIGHTRO1
   object by means of '(import' In-Form statements and
  at the end of calculation dumps it at the east boundary in the    
  EASTTRO2
   object.
                                                                    
  The third run reads the 
  EASTTRO1
   object and forms the
  HIGHTRO3
   object.

  The fourth run reads the information from 
  HIGHTRO3 
  and EASTTRO2 import transfer objects at the low and west 
  boundaries.
                                                                    
  In general there can be any number of transfer objects.           
                                                                    
  Each run simulates the distribution of pollution in one part.     
                                                                    
  The wind profile at inlet boundaries is set by means of           
  
  In-Form statements as a logarithmic velocity profile.
                                                                    
  The ground relief (HIG variable) is calculated by this
  
  In-Form formula.
                                                                    
  The MARK variable 
  defined 
  by In-Form is used for the image of ground relief in Photon.

  The ground roughness is simulated by a change of air density 
  driven by the height of an atmospheric layer. Density of air is 
  calculated
  by barom$
etric formula by means of In-Form.                              
                                                                    
  The last, fifth, run  simulates the flow in the whole region      
  without partitioning. It will be useful as a comparison           
  to the previous runs.                                             
                                                                    
  The Q1 contains PHOTON USE commands                               
  ENDDIS                                                            
  PHOTON USE                                                        
  p                                                                 
  phi1                                                              
  1 5 1;;                                                           
                                                                    
  VI -1 1 1                                                         
  gr ou y 1                                                         
  SURF MARK Y .99                                                   
  SURF MARK X .99                                                   
  SURF MARK Z .99                                                   
  msg First run: ground geometry                                    
  pause                                                             
  p                                                                 
  phi1;;;                                                           
                                                                    
  vi y                                                              
  gr ou y 1                                                         
  con rho1 y m fi;.001                                              
  msg density contours                                              
  pause                                                             
  con cl;red                                                        
  ve y 1 sh                                                         
  msg velocity vectors                                              
  pause                                                             
  con cl;red                                                        
  set con scale range on                                            
  con conc y 1 fi;0 0.0028;.001                                     
  set con scale range off                                           
  msg concentration contours                                        
  pause                                                             
  p                                                                 
  phi2                                                              
  1 5 1;;                                                           
                                                                    
  VI -1 1 1                                                         
  gr ou y 1                                                         
  SURF MARK Y .99                                                   
  SURF MARK X .99                                                   
  SURF MARK Z .99                                                   
  msg Second run: ground geometry                                   
  pause                                                             
  p                                                                 
  phi2;;;                                                           
                                                                    
  vi y                                                              
  gr ou y 1                                                         
  con rho1 y m fi;.001                                              
  msg density contours                                              
  pause                                                             
  con cl;red                                                        
  ve y 1 sh                                                         
  msg velocity vectors                                              
  pause                                                             
  con cl;red                                                        
  set con scale range on                                            
  con conc y 1 fi;0 0.0028;.001                                     
  set con scale range off                                           
  msg concentration contours                                        
  pause                                                             
  p                                                                 
  phi3                                                              
  1 5 1;;                                                           
                                                                    
  VI -1 1 1                                                         
  gr ou y 1                                                         
  SURF MARK Y .99                                                   
  SURF MARK X .99                                                   
  SURF MARK Z .99                                                   
  msg Third run: ground geometry                                    
  pause                                                             
  p                                                                 
  phi3;;;                                                           
                                                                    
  vi y                                                              
  gr ou y 1                                                         
  con rho1 y m fi;.001                                              
  msg density contours                                              
  pause                                                             
  con cl;red                                                        
  ve y 1 sh                                                         
  msg velocity vectors                                              
  pause                                                             
  con cl;red                                                        
  set con scale range on                                            
  con conc y 1 fi;0 0.0028;.001                                     
  set con scale range off                                           
  msg concentration contours                                        
  pause                                                             
  p                                                                 
  phi4                                                              
  1 5 1;;                                                           
                                                                    
  VI -1 1 1                                                         
  gr ou y 1                                                         
  SURF MARK Y .99                                                   
  SURF MARK X .99                                                   
  SURF MARK Z .99                                                   
  msg Fourth run: ground geometry                                   
  pause                                                             
  p                                                                 
  phi4;;;                                                           
                                                                    
  vi y                                                              
  gr ou y 1                                                         
  con rho1 y m fi;.001                                              
  msg density contours                                              
  pause                                                             
  con cl;red                                                        
  ve y 1 sh                                                         
  msg velocity vectors                                              
  pause                                                             
  con cl;red                                                        
  set con scale range on                                            
  con conc y 1 fi;0 0.0028;.001                                     
  set con scale range off                                           
  msg concentration contours                                        
  pause                                                             
  p                                                                 
  phi5                                                              
  1 5 1;;                                                           
                                                                    
  VI -1 1 1                                                         
  gr ou y 1                                                         
  SURF MARK Y .99                                                   
  SURF MARK X .99                                                   
  SURF MARK Z .99                                                   
  msg Fifth run: ground geometry                                    
  pause                                                             
  p                                                                 
  phi5;;;                                                           
                                                                    
  vi y                                                              
  gr ou y 1                                                         
  con rho1 y m fi;.001                                              
  msg density contours                                              
  pause                                                             
  con cl;red                                                        
  ve y 1 sh                                                         
  msg velocity vectors                                              
  pause                                                             
  con cl;red                                                        
  set con scale range on                                            
  con conc y 1 fi;0 0.0028;.001                                     
  set con scale range off                                           
  msg concentration contours                                        
  ENDUSE                                                            
                                                                    
    First run                                                       
    ---------                                                       
                                                                    
  Group 1. Run Title and Number                                     
 TEXT(ATMOSPHERIC B.L., first run             )                     
  Group 3. X-Direction Grid Spacing                                 
GRDPWR(X,25,5000,1)                                                 
  Group 4. Y-Direction Grid Spacing                                 
GRDPWR(Y,20,1000,2.0)                                               
  Group 5. Z-Direction Grid Spacing                                 
GRDPWR(Z,25,5000,1)                                                 
  Group 7. Variables: STOREd,SOLVEd,NAMEd                           
SOLVE(P1,U1,V1,W1,CONC)                                             
STORE(EPKE,ENUT,EL1,HIG,MARK,RHO1)                                  
SOLUTN(P1,Y,Y,Y,N,N,Y)                                              
TURMOD(KEMODL)                                                      
  Group 9. Properties                                               
PRESS0= 1.000000E+05; TEMP0= 2.730000E+02                           
SETPRPS(1,  0) ! Domain material is: 0   Air at 20 deg C, 1 atm     
DVO1DT= 3.410000E-03                                                
PRT(EP)=  1.314000E+00                                              
  Group 13. Boundary & Special Sources                              
                                                                    
     ! outlets                                                      
PATCH(HOUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
COVAL(HOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(EOUT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
COVAL(EOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(NOUT,NORTH,1,NX,NY,NY,1,NZ,1,1)                               
COVAL(NOUT,P1,5.E-4,0.)                                             
                                                                    
     ! pollution source                                             
PATCH(SOURCE,CELL,1,7,1,1,1,4,1,1)                                  
COVAL(SOURCE,CONC,FIXFLU,1.0)                                       
                                                                    
     ! ground bourndary                                             
PATCH(GROUND,SWALL,1,NX,1,1,1,NZ,1,1)                               
COVAL(GROUND,U1,GRND5,0.)                                           
COVAL(GROUND,W1,GRND5,0.)                                           
COVAL(GROUND,KE,GRND5,GRND5)                                        
COVAL(GROUND,EP,GRND5,GRND5)                                        
WALLA   = 2.000000E-02 ;WALLB  = 0.000000E+00                       
EGWF    =    T                                                      
WALLCO  = GRND5                                                     
                                                                    
  !inlets by power-law form:Uy=Uh*(y/h)**alfa
REAL(VELX,VELZ,REFH,ALPHA)                                          
REAL(AK,ZO,HO,QREF,QTAU,QTAU2,GKEIN,GEPCON,CONST,VEL2,RH)           
VELX=1.0   ! x component of inlet velocity                          
VELZ=1.0   ! z component of inlet velocity                          
REFH=10.   ! reference height for wind reference velocity           
ALPHA=0.21 !                                                        
AK=0.41    ! constant                                               
ZO=0.022   ! effective roughness length                             
HO=0.0     ! height of boundary-layer origin above domain origin    
VEL2=VELX*VELX+VELZ*VELZ                                            
QREF=SQRT(VEL2) ! inlet velocity                                    
RH=REFH/ZO                                                          
QTAU=AK*QREF/(LOG(RH))                                              
QTAU2=QTAU*QTAU                                                     
GKEIN=QTAU2/0.3       ! inlet k                                     
GEPCON=QTAU2*QTAU/AK                                                
                                                                    
PATCH(LINLET,LOW,1,NX,1,NY,1,1,1,1)                                 
CONST=ABS(VELZ)/REFH**ALPHA                                         
(SOURCE of P1 at LINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at LINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at LINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
PATCH(WINLET,WEST,1,1,1,NY,1,NZ,1,1)                                
CONST=ABS(VELX)/REFH**ALPHA                                         
(SOURCE of P1 at WINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at WINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at WINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
     ! Boundary at top                                              
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
                                                                    
REAL(XSIZE,ZSIZE,X0,Z0)                                             
XSIZE=2*XULAST; ZSIZE=2*ZWLAST ! size of explored area              
X0=0; Z0=0 ! coordinates of origin on explored area                 
                                                                    
   ! ground relief                      
(STORED HIG AT GROUND IS 100.*(1-(X0+XG)/XSIZE)*(1-(Z0+ZG)/ZSIZE)*($
2.+SIN(6*(X0+XG)/XSIZE)+SIN(24*(Z0+ZG)/ZSIZE)) WITH TSTSTR)         
                                                                    
         ! geometry marker                    
(STORED MARK IS 1 WITH IF(YG.GT.HIG[,1])!TSTSTR)                    
                                                                    
          ! air density                        
(PROPERTY RHO1 IS 1.189*EXP((YG+HIG[,1])/(-8000)))                  
                                                                    
   ! create export transfer objects            
PATCH(HPAT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
(EXPORT in HIGHTRO1 at HPAT)                                        
PATCH(EPAT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
(EXPORT in EASTTRO1 at EPAT)                                        
  Group 15. Terminate Sweeps                                        
LSWEEP=150                                                          
  Group 18. Limits                                                  
VARMIN(CONC)=0.                                                     
  Group 22. Monitor Print-Out                                       
IXMON=NX/2;IYMON=NY/2;IZMON=NZ-2                                    
TSTSWP=-1                                                           
DISTIL=T                                                            
EX(P1  )=1.362E+03                                                  
EX(U1  )=1.320E+00                                                  
EX(V1  )=1.860E-01                                                  
EX(W1  )=1.289E+00                                                  
EX(KE  )=4.055E-02                                                  
EX(EP  )=5.847E-04                                                  
EX(RHO1)=1.120E+00                                                  
EX(MARK)=6.183E-01                                                  
EX(HIG )=7.655E+00                                                  
EX(EL1 )=1.088E+02                                                  
EX(ENUT)=1.356E+01                                                  
EX(EPKE)=1.000E-10                                                  
EX(CONC)=3.035E-05                                                  
NSAVE=PHI1                                                          
LSG57=T;ISG52=2                                                     
STOP                                                                
                                                                    
                                                                    
    Second run                                                      
    ----------                                                      
                                                                    
  Group 1. Run Title and Number                                     
 TEXT(ATMOSPHERIC B.L., second run             )                    
  Group 3. X-Direction Grid Spacing                                 
GRDPWR(X,25,5000,1)                                                 
  Group 4. Y-Direction Grid Spacing                                 
GRDPWR(Y,20,1000,2.0)                                               
  Group 5. Z-Direction Grid Spacing                                 
GRDPWR(Z,25,5000,1)                                                 
  Group 7. Variables: STOREd,SOLVEd,NAMEd                           
SOLVE(P1,U1,V1,W1,CONC)                                             
STORE(EPKE,ENUT,EL1,HIG,MARK,RHO1)                                  
SOLUTN(P1,Y,Y,Y,N,N,Y)                                              
TURMOD(KEMODL)                                                      
  Group 9. Properties                                               
PRESS0= 1.000000E+05; TEMP0= 2.730000E+02                           
SETPRPS(1,  0) ! Domain material is: 0   Air at 20 deg C, 1 atm     
DVO1DT= 3.410000E-03                                                
PRT(EP)=  1.314000E+00                                              
  Group 13. Boundary & Special Sources                              
                                                                    
     ! outlets                                                      
PATCH(HOUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
COVAL(HOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(EOUT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
COVAL(EOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(NOUT,NORTH,1,NX,NY,NY,1,NZ,1,1)                               
COVAL(NOUT,P1,5.E-4,0.)                                             
                                                                    
     ! ground bourndary                                             
PATCH(GROUND,SWALL,1,NX,1,1,1,NZ,1,1)                               
COVAL(GROUND,U1,GRND5,0.)                                           
COVAL(GROUND,W1,GRND5,0.)                                           
COVAL(GROUND,KE,GRND5,GRND5)                                        
COVAL(GROUND,EP,GRND5,GRND5)                                        
WALLA   = 2.000000E-02 ;WALLB  = 0.000000E+00                       
EGWF    =    T                                                      
WALLCO  = GRND5                                                     
                                                                    
     ! inlets by power-law form:  Uy=Uh*(y/h)**alfa                 
REAL(VELX,VELZ,REFH,ALPHA)                                          
REAL(AK,ZO,HO,QREF,QTAU,QTAU2,GKEIN,GEPCON,CONST,VEL2,RH)           
VELX=1.0   ! x component of inlet velocity                          
VELZ=1.0   ! z component of inlet velocity                          
REFH=10.   ! reference height for wind reference velocity           
ALPHA=0.21 !                                                        
AK=0.41    ! constant                                               
ZO=0.022   ! effective roughness length                             
HO=0.0     ! height of boundary-layer origin above domain origin    
VEL2=VELX*VELX+VELZ*VELZ                                            
QREF=SQRT(VEL2) ! inlet velocity                                    
RH=REFH/ZO                                                          
QTAU=AK*QREF/(LOG(RH))                                              
QTAU2=QTAU*QTAU                                                     
GKEIN=QTAU2/0.3       ! inlet k                                     
GEPCON=QTAU2*QTAU/AK                                                
                                                                    
PATCH(WINLET,WEST,1,1,1,NY,1,NZ,1,1)                                
CONST=ABS(VELX)/REFH**ALPHA                                         
(SOURCE of P1 at WINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at WINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at WINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
     ! Boundary at top                                              
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
                                                                    
REAL(XSIZE,ZSIZE,X0,Z0)                                             
XSIZE=2*XULAST; ZSIZE=2*ZWLAST  ! size of explored area             
X0=0; Z0=ZWLAST ! coordinates of origin on explored area            
                                                                    
   ! ground relief                     
(STORED HIG AT GROUND IS 100.*(1-(X0+XG)/XSIZE)*(1-(Z0+ZG)/ZSIZE)*($
2.+SIN(6*(X0+XG)/XSIZE)+SIN(24*(Z0+ZG)/ZSIZE)) WITH TSTSTR)         
                                                                    
         ! geometry marker                   
(STORED MARK IS 1 WITH IF(YG.GT.HIG[,1])!TSTSTR)                    
                                                                    
          ! air density                       
(PROPERTY RHO1 IS 1.189*EXP((YG+HIG[,1])/(-8000)))                  
                                                                    
   ! read exist transfer object                
PATCH(LPAT,LOW,1,NX,1,NY,1,1,1,1)                                   
(IMPORT from HIGHTRO1 at LPAT)                                      
                                                                    
   ! create transfer object                    
PATCH(EPAT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
(EXPORT in EASTTRO2 at EPAT)                                        
  Group 15. Terminate Sweeps                                        
LSWEEP=150                                                          
  Group 18. Limits                                                  
VARMIN(CONC)=0.                                                     
  Group 22. Monitor Print-Out                                       
IXMON=NX/2;IYMON=NY/2;IZMON=NZ-2                                    
TSTSWP=-1                                                           
DISTIL=T                                                            
EX(P1  )=8.817E+02                                                  
EX(U1  )=1.221E+00                                                  
EX(V1  )=1.237E-01                                                  
EX(W1  )=4.717E-01                                                  
EX(KE  )=3.173E-02                                                  
EX(EP  )=2.337E-04                                                  
EX(RHO1)=1.134E+00                                                  
EX(MARK)=7.909E-01                                                  
EX(HIG )=2.626E+00                                                  
EX(EL1 )=1.108E+02                                                  
EX(ENUT)=1.255E+01                                                  
EX(EPKE)=1.000E-10                                                  
EX(CONC)=1.830E-06                                                  
NSAVE=PHI2                                                          
LSG57=T;ISG52=2                                                     
STOP                                                                
                                                                    
                                                                    
                                                                    
    Third run                                                       
    ---------                                                       
                                                                    
  Group 1. Run Title and Number                                     
TEXT(ATMOSPHERIC B.L., Third run             )                      
  Group 3. X-Direction Grid Spacing                                 
GRDPWR(X,25,5000,1)                                                 
  Group 4. Y-Direction Grid Spacing                                 
GRDPWR(Y,20,1000,2.0)                                               
  Group 5. Z-Direction Grid Spacing                                 
GRDPWR(Z,25,5000,1)                                                 
  Group 7. Variables: STOREd,SOLVEd,NAMEd                           
SOLVE(P1,U1,V1,W1,CONC)                                             
STORE(EPKE,ENUT,EL1,HIG,MARK,RHO1)                                  
SOLUTN(P1,Y,Y,Y,N,N,Y)                                              
TURMOD(KEMODL)                                                      
  Group 9. Properties                                               
PRESS0= 1.000000E+05; TEMP0= 2.730000E+02                           
SETPRPS(1,  0) ! Domain material is: 0   Air at 20 deg C, 1 atm     
DVO1DT= 3.410000E-03                                                
PRT(EP)=  1.314000E+00                                              
  Group 13. Boundary & Special Sources                              
                                                                    
     ! outlets                                                      
PATCH(HOUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
COVAL(HOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(EOUT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
COVAL(EOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(NOUT,NORTH,1,NX,NY,NY,1,NZ,1,1)                               
COVAL(NOUT,P1,5.E-4,0.)                                             
                                                                    
     ! ground bourndary                                             
PATCH(GROUND,SWALL,1,NX,1,1,1,NZ,1,1)                               
COVAL(GROUND,U1,GRND5,0.)                                           
COVAL(GROUND,W1,GRND5,0.)                                           
COVAL(GROUND,KE,GRND5,GRND5)                                        
COVAL(GROUND,EP,GRND5,GRND5)                                        
WALLA   = 2.000000E-02 ;WALLB  = 0.000000E+00                       
EGWF    =    T                                                      
WALLCO  = GRND5                                                     
                                                                    
     ! inlets by power-law form:  Uy=Uh*(y/h)**alfa                 
REAL(VELX,VELZ,REFH,ALPHA)                                          
REAL(AK,ZO,HO,QREF,QTAU,QTAU2,GKEIN,GEPCON,CONST,VEL2,RH)           
VELX=1.0   ! x component of inlet velocity                          
VELZ=1.0   ! z component of inlet velocity                          
REFH=10.   ! reference height for wind reference velocity           
ALPHA=0.21 !                                                        
AK=0.41    ! constant                                               
ZO=0.022   ! effective roughness length                             
HO=0.0     ! height of boundary-layer origin above domain origin    
VEL2=VELX*VELX+VELZ*VELZ                                            
QREF=SQRT(VEL2) ! inlet velocity                                    
RH=REFH/ZO                                                          
QTAU=AK*QREF/(LOG(RH))                                              
QTAU2=QTAU*QTAU                                                     
GKEIN=QTAU2/0.3       ! inlet k                                     
GEPCON=QTAU2*QTAU/AK                                                
                                                                    
PATCH(LINLET,LOW,1,NX,1,NY,1,1,1,1)                                 
CONST=ABS(VELZ)/REFH**ALPHA                                         
(SOURCE of P1 at LINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at LINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at LINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
     ! Boundary at top                                              
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
                                                                    
REAL(XSIZE,ZSIZE,X0,Z0)                                             
XSIZE=2*XULAST; ZSIZE=2*ZWLAST  ! size of explored area             
X0=XULAST; Z0=0 ! coordinates of origin on explored area            
                                                                    
   ! ground relief                     
(STORED HIG AT GROUND IS 100.*(1-(X0+XG)/XSIZE)*(1-(Z0+ZG)/ZSIZE)*($
2.+SIN(6*(X0+XG)/XSIZE)+SIN(24*(Z0+ZG)/ZSIZE)) WITH TSTSTR)         
                                                                    
         ! geometry marker                   
(STORED MARK IS 1 WITH IF(YG.GT.HIG[,1])!TSTSTR)                    
                                                                    
          ! air density                       
(PROPERTY RHO1 IS 1.189*EXP((YG+HIG[,1])/(-8000)))                  
                                                                    
   ! read transfer object                      
PATCH(WPAT,WEST,1,1,1,NY,1,NZ,1,1)                                  
(IMPORT from EASTTRO1 at WPAT)                                      
                                                                    
   ! create transfer object                    
PATCH(HPAT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
(EXPORT in HIGHTRO3 at HPAT)                                        
  Group 15. Terminate Sweeps                                        
LSWEEP=150                                                          
  Group 18. Limits                                                  
VARMIN(CONC)=0.                                                     
  Group 22. Monitor Print-Out                                       
IXMON=NX/2;IYMON=NY/2;IZMON=NZ-2                                    
TSTSWP=-1                                                           
DISTIL=T                                                            
EX(P1  )=8.828E+02                                                  
EX(U1  )=4.706E-01                                                  
EX(V1  )=1.234E-01                                                  
EX(W1  )=1.220E+00                                                  
EX(KE  )=3.165E-02                                                  
EX(EP  )=2.319E-04                                                  
EX(RHO1)=1.137E+00                                                  
EX(MARK)=8.582E-01                                                  
EX(HIG )=1.407E+00                                                  
EX(EL1 )=1.106E+02                                                  
EX(ENUT)=1.251E+01                                                  
EX(EPKE)=1.000E-10                                                  
EX(CONC)=2.626E-06                                                  
NSAVE=PHI3                                                          
LSG57=T;ISG52=2                                                     
STOP                                                                
                                                                    
                                                                    
    fourth run                                                      
    ----------                                                      
                                                                    
  Group 1. Run Title and Number                                     
TEXT(ATMOSPHERIC B.L., fourth run            )                      
  Group 3. X-Direction Grid Spacing                                 
GRDPWR(X,25,5000,1)                                                 
  Group 4. Y-Direction Grid Spacing                                 
GRDPWR(Y,20,1000,2.0)                                               
  Group 5. Z-Direction Grid Spacing                                 
GRDPWR(Z,25,5000,1)                                                 
  Group 7. Variables: STOREd,SOLVEd,NAMEd                           
SOLVE(P1,U1,V1,W1,CONC)                                             
STORE(EPKE,ENUT,EL1,HIG,MARK,RHO1)                                  
SOLUTN(P1,Y,Y,Y,N,N,Y)                                              
TURMOD(KEMODL)                                                      
  Group 9. Properties                                               
PRESS0= 1.000000E+05; TEMP0= 2.730000E+02                           
SETPRPS(1,  0) ! Domain material is: 0   Air at 20 deg C, 1 atm     
DVO1DT= 3.410000E-03                                                
PRT(EP)=  1.314000E+00                                              
  Group 13. Boundary & Special Sources                              
                                                                    
     ! outlets                                                      
PATCH(HOUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
COVAL(HOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(EOUT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
COVAL(EOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(NOUT,NORTH,1,NX,NY,NY,1,NZ,1,1)                               
COVAL(NOUT,P1,5.E-4,0.)                                             
                                                                    
     ! ground bourndary                                             
PATCH(GROUND,SWALL,1,NX,1,1,1,NZ,1,1)                               
COVAL(GROUND,U1,GRND5,0.)                                           
COVAL(GROUND,W1,GRND5,0.)                                           
COVAL(GROUND,KE,GRND5,GRND5)                                        
COVAL(GROUND,EP,GRND5,GRND5)                                        
WALLA   = 2.000000E-02 ;WALLB  = 0.000000E+00                       
EGWF    =    T                                                      
WALLCO  = GRND5                                                     
                                                                    
REAL(VELX,VELZ,REFH,ALPHA,CONST)                                    
VELX=1.0   ! x component of inlet velocity                          
VELZ=1.0   ! z component of inlet velocity                          
REFH=10.   ! reference height for wind reference velocity           
ALPHA=0.21 !                                                        
     ! Boundary at top                                              
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
                                                                    
REAL(XSIZE,ZSIZE,X0,Z0)                                             
XSIZE=2*XULAST; ZSIZE=2*ZWLAST  ! size of explored area             
X0=XULAST; Z0=ZWLAST ! coordinates of origin on explored area       
                                                                    
   ! ground relief                     
(STORED HIG AT GROUND IS 100.*(1-(X0+XG)/XSIZE)*(1-(Z0+ZG)/ZSIZE)*($
2.+SIN(6*(X0+XG)/XSIZE)+SIN(24*(Z0+ZG)/ZSIZE)) WITH TSTSTR)         
                                                                    
         ! geometry marker                   
(STORED MARK IS 1 WITH IF(YG.GT.HIG[,1])!TSTSTR)                    
                                                                    
          ! air density                       
(PROPERTY RHO1 IS 1.189*EXP((YG+HIG[,1])/(-8000)))                  
                                                                    
   ! read transfer objects                     
PATCH(LPAT,LOW,1,NX,1,NY,1,1,1,1)                                   
(IMPORT from HIGHTRO3 at LPAT)                                      
PATCH(WPAT,WEST,1,1,1,NY,1,NZ,1,1)                                  
(IMPORT from EASTTRO2 at WPAT)                                      
  Group 15. Terminate Sweeps                                        
LSWEEP=150                                                          
  Group 18. Limits                                                  
VARMIN(CONC)=0.                                                     
  Group 22. Monitor Print-Out                                       
IXMON=NX/2;IYMON=NY/2;IZMON=NZ-2                                    
TSTSWP=-1                                                           
DISTIL=T                                                            
EX(P1  )=2.412E+02                                                  
EX(U1  )=2.337E-01                                                  
EX(V1  )=3.537E-02                                                  
EX(W1  )=2.339E-01                                                  
EX(KE  )=6.542E-03                                                  
EX(EP  )=4.847E-06                                                  
EX(RHO1)=1.137E+00                                                  
EX(MARK)=9.249E-01                                                  
EX(HIG )=4.938E-01                                                  
EX(EL1 )=8.286E+01                                                  
EX(ENUT)=4.018E+00                                                  
EX(EPKE)=1.000E-10                                                  
EX(CONC)=2.431E-05                                                  
NSAVE=PHI4                                                          
LSG57=T;ISG52=2                                                     
STOP                                                                
                                                                    
    fifth run                                                       
    ----------                                                      
                                                                    
  Group 1. Run Title and Number                                     
 TEXT(ATMOSPHERIC B.L., fifth run             )                     
  Group 3. X-Direction Grid Spacing                                 
GRDPWR(X,50,10000,1)                                                
  Group 4. Y-Direction Grid Spacing                                 
GRDPWR(Y,20,1000,2.0)                                               
  Group 5. Z-Direction Grid Spacing                                 
GRDPWR(Z,50,10000,1)                                                
  Group 7. Variables: STOREd,SOLVEd,NAMEd                           
SOLVE(P1,U1,V1,W1,CONC)                                             
STORE(EPKE,ENUT,EL1,HIG,MARK,RHO1)                                  
SOLUTN(P1,Y,Y,Y,N,N,Y)                                              
TURMOD(KEMODL)                                                      
  Group 9. Properties                                               
PRESS0= 1.000000E+05; TEMP0= 2.730000E+02                           
SETPRPS(1,  0) ! Domain material is: 0   Air at 20 deg C, 1 atm     
DVO1DT= 3.410000E-03                                                
PRT(EP)=  1.314000E+00                                              
  Group 13. Boundary & Special Sources                              
                                                                    
     ! outlets                                                      
PATCH(HOUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)                                
COVAL(HOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(EOUT,EAST,NX,NX,1,NY,1,NZ,1,1)                                
COVAL(EOUT,P1,5.E-4,0.)                                             
                                                                    
PATCH(NOUT,NORTH,1,NX,NY,NY,1,NZ,1,1)                               
COVAL(NOUT,P1,5.E-4,0.)                                             
                                                                    
     ! pollution source                                             
PATCH(SOURCE,CELL,1,7,1,1,1,4,1,1)                                  
COVAL(SOURCE,CONC,FIXFLU,1.0)                                       
                                                                    
     ! ground bourndary                                             
PATCH(GROUND,SWALL,1,NX,1,1,1,NZ,1,1)                               
COVAL(GROUND,U1,GRND5,0.)                                           
COVAL(GROUND,W1,GRND5,0.)                                           
COVAL(GROUND,KE,GRND5,GRND5)                                        
COVAL(GROUND,EP,GRND5,GRND5)                                        
WALLA   = 2.000000E-02 ;WALLB  = 0.000000E+00                       
EGWF    =    T                                                      
WALLCO  = GRND5                                                     
                                                                    
                                                                    
     ! inlets by power-law form:  Uy=Uh*(y/h)**alfa                 
REAL(VELX,VELZ,REFH,ALPHA)                                          
REAL(AK,ZO,HO,QREF,QTAU,QTAU2,GKEIN,GEPCON,CONST,VEL2,RH)           
VELX=1.0   ! x component of inlet velocity                          
VELZ=1.0   ! z component of inlet velocity                          
REFH=10.   ! reference height for wind reference velocity           
ALPHA=0.21 !                                                        
AK=0.41    ! constant                                               
ZO=0.022   ! effective roughness length                             
HO=0.0     ! height of boundary-layer origin above domain origin    
VEL2=VELX*VELX+VELZ*VELZ                                            
QREF=SQRT(VEL2) ! inlet velocity                                    
RH=REFH/ZO                                                          
QTAU=AK*QREF/(LOG(RH))                                              
QTAU2=QTAU*QTAU                                                     
GKEIN=QTAU2/0.3       ! inlet k                                     
GEPCON=QTAU2*QTAU/AK                                                
                                                                    
PATCH(LINLET,LOW,1,NX,1,NY,1,1,1,1)                                 
CONST=ABS(VELZ)/REFH**ALPHA                                         
(SOURCE of P1 at LINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at LINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at LINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at LINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
PATCH(WINLET,WEST,1,1,1,NY,1,NZ,1,1)                                
CONST=ABS(VELX)/REFH**ALPHA                                         
(SOURCE of P1 at WINLET is 1.189*EXP((YG+HIG[,1])/(-8000))*CONST*YG$
^ALPHA)                                                             
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at WINLET is CONST*YG^ALPHA with ONLYMS)              
(SOURCE of KE at WINLET is GKEIN with ONLYMS)                       
(SOURCE of EP at WINLET is GEPCON/(YG-HO) with ONLYMS)              
                                                                    
     ! Boundary at top                                              
CONST=VELX/REFH**ALPHA                                              
(SOURCE of U1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
CONST=VELZ/REFH**ALPHA                                              
(SOURCE of W1 at NOUT is CONST*YG^ALPHA with ONLYMS)                
                                                                    
REAL(XSIZE,ZSIZE,X0,Z0)                                             
XSIZE=XULAST; ZSIZE=ZWLAST ! size of explored area                  
X0=0; Z0=0 ! coordinates of origin on explored area                 
                                                                    
   ! ground relief                      
                                                                    
(STORED HIG AT GROUND IS 100.*(1-(X0+XG)/XSIZE)*(1-(Z0+ZG)/ZSIZE)*($
2.+SIN(6*(X0+XG)/XSIZE)+SIN(24*(Z0+ZG)/ZSIZE)) WITH TSTSTR)         
                                                                    
         ! geometry marker                    
(STORED MARK IS 1 WITH IF(YG.GT.HIG[,1])!TSTSTR)                    
                                                                    
          ! air density                        
(PROPERTY RHO1 IS 1.189*EXP((YG+HIG[,1])/(-8000)))                  
                                                                    
  Group 15. Terminate Sweeps                                        
LSWEEP=150                                                          
  Group 18. Limits                                                  
VARMIN(CONC)=0.                                                     
  Group 22. Monitor Print-Out                                       
IXMON=NX/2;IYMON=NY/2;IZMON=NZ-2                                    
TSTSWP=-1                                                           
DISTIL=T                                                            
EX(P1  )=8.391E+02                                                  
EX(U1  )=9.027E-01                                                  
EX(V1  )=1.169E-01                                                  
EX(W1  )=9.015E-01                                                  
EX(KE  )=2.850E-02                                                  
EX(EP  )=3.068E-04                                                  
EX(RHO1)=1.120E+00                                                  
EX(MARK)=7.981E-01                                                  
EX(HIG )=3.045E+00                                                  
EX(EL1 )=1.040E+02                                                  
EX(ENUT)=1.096E+01                                                  
EX(EPKE)=1.000E-10                                                  
EX(CONC)=1.391E-05                                                  
NSAVE=PHI5                                                          
LSG57=T;ISG52=2                                                     
STOP                                                                
STOP