/[MITgcm]/MITgcm/verification/internal_wave/code/obcs_calc.F
ViewVC logotype

Diff of /MITgcm/verification/internal_wave/code/obcs_calc.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2 by adcroft, Fri Feb 2 21:36:34 2001 UTC revision 1.5 by mlosch, Wed Aug 7 16:55:52 2002 UTC
# Line 3  C $Name$ Line 3  C $Name$
3    
4  #include "OBCS_OPTIONS.h"  #include "OBCS_OPTIONS.h"
5    
6        SUBROUTINE OBCS_CALC( bi, bj, futureTime,        SUBROUTINE OBCS_CALC( bi, bj, futureTime, futureIter,
7       &                      uVel, vVel, wVel, theta, salt,       &                      uVel, vVel, wVel, theta, salt,
8       &                      myThid )       &                      myThid )
9  C     /==========================================================\  C     /==========================================================\
# Line 19  C     === Global variables === Line 19  C     === Global variables ===
19  #include "SIZE.h"  #include "SIZE.h"
20  #include "EEPARAMS.h"  #include "EEPARAMS.h"
21  #include "PARAMS.h"  #include "PARAMS.h"
22    #include "EOS.h"
23  #include "OBCS.h"  #include "OBCS.h"
24    
25  C     == Routine arguments ==  C     == Routine arguments ==
26        INTEGER bi, bj        INTEGER bi, bj
27          INTEGER futureIter
28        _RL futureTime        _RL futureTime
29        _RL uVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL uVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
30        _RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)        _RL vVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
# Line 43  C     == Local variables == Line 45  C     == Local variables ==
45        _RL tmpsum        _RL tmpsum
46    
47  C Vertical mode number  C Vertical mode number
48        mz=1.0        mz=1.0 _d 0
49  C Stratification  C Stratification
50        strat = 1.0 _d -6 / (gravity*tAlpha)        strat = 1.0 _d -6 / (gravity*tAlpha)
51    
# Line 58  C Create a vertical structure function w Line 60  C Create a vertical structure function w
60         vertStructWst(K)=vertStructWst(K)-tmpsum         vertStructWst(K)=vertStructWst(K)-tmpsum
61        enddo        enddo
62  c  c
63        obTimeScale = 44567.0        obTimeScale = 44567.0 _d 0
64         kx=mz*2.*pi/400.0*sqrt((2.0*pi*2.0*pi/(obTimeScale*obTimeScale)         kx=mz*2. _d 0*pi/400.0 _d 0
65         &  *sqrt((2.0 _d 0*pi*2.0 _d 0*pi/(obTimeScale*obTimeScale)
66       & - f0*f0)/(1.0 _d -6       & - f0*f0)/(1.0 _d -6
67       & - 2.0*pi*2.0*pi/(obTimeScale*obTimeScale)))       & - 2.0 _d 0*pi*2.0 _d 0*pi/(obTimeScale*obTimeScale)))
68        Uinflow = 0.024        Uinflow = 0.024 _d 0
69        rampTime2 = 4*44567.0  C *NOTE* I have commented out the ramp function below
70    C just to speed things up. You will probably want to use it
71    C for smoother looking solutions.
72          rampTime2 = 4. _d 0*44567.0 _d 0
73    
74    
75  C     Eastern OB  C     Eastern OB
# Line 95  C     Western OB Line 101  C     Western OB
101        ELSE        ELSE
102          DO K=1,Nr          DO K=1,Nr
103            DO J=1-Oly,sNy+Oly            DO J=1-Oly,sNy+Oly
104            OBWu(J,K,bi,bj)=0.            OBWu(J,K,bi,bj)=0. _d 0
105       &       +Uinflow       &       +Uinflow
106       &       *vertStructWst(K)       &       *vertStructWst(K)
107       &       *sin(2.*PI*futureTime/obTimeScale)       &       *sin(2. _d 0*PI*futureTime/obTimeScale)
108       &       *(exp(futureTime/rampTime2)  c    &       *(exp(futureTime/rampTime2)
109       &   - exp(-futureTime/rampTime2))  c    &   - exp(-futureTime/rampTime2))
110       &   /(exp(futureTime/rampTime2)  c    &   /(exp(futureTime/rampTime2)
111       &  + exp(-futureTime/rampTime2))  c    &  + exp(-futureTime/rampTime2))
112       &   *cos(kx*(3-2-0.5)*delX(1))       &   *cos(kx*(3. _d 0-2. _d 0-0.5 _d 0)*delX(1))
113            OBWv(J,K,bi,bj)=0.            OBWv(J,K,bi,bj)=0. _d 0
114       &       +Uinflow       &       +Uinflow
115       &       *f0/(2.0*PI/obTimeScale)       &       *f0/(2.0 _d 0*PI/obTimeScale)
116       &       *vertStructWst(K)       &       *vertStructWst(K)
117       &       *cos(2.*PI*futureTime/obTimeScale )       &       *cos(2. _d 0*PI*futureTime/obTimeScale )
118       & * (exp(futureTime/rampTime2)       & * (exp(futureTime/rampTime2)
119       &   - exp(-futureTime/rampTime2))       &   - exp(-futureTime/rampTime2))
120       &   /(exp(futureTime/rampTime2)       &   /(exp(futureTime/rampTime2)
121       &  + exp(-futureTime/rampTime2))       &  + exp(-futureTime/rampTime2))
122            OBWt(J,K,bi,bj)=tRef(K)            OBWt(J,K,bi,bj)=tRef(K)
123       & + Uinflow*sin(mz*PI*(float(k)-0.5)/float(Nr))       & + Uinflow*sin(mz*PI*(float(k)-0.5 _d 0)/float(Nr))
124       & * sin(2.0*PI*futureTime/obTimeScale)       & * sin(2.0 _d 0*PI*futureTime/obTimeScale)
125       & *sqrt(strat/(tAlpha*gravity))       & *sqrt(strat/(tAlpha*gravity))
126       & *sqrt(2.0*PI/obTimeScale*2.0*PI/obTimeScale - f0*f0)       & *sqrt(2.0 _d 0*PI/obTimeScale*2.0*PI/obTimeScale - f0*f0)
127       & /(2.0*PI/obTimeScale)       & /(2.0 _d 0*PI/obTimeScale)
128       & * (exp(futureTime/rampTime2)  c    & * (exp(futureTime/rampTime2)
129       &   - exp(-futureTime/rampTime2))  c    &   - exp(-futureTime/rampTime2))
130       &   /(exp(futureTime/rampTime2)  c    &   /(exp(futureTime/rampTime2)
131       &  + exp(-futureTime/rampTime2))  c    &  + exp(-futureTime/rampTime2))
132  #ifdef ALLOW_NONHYDROSTATIC  #ifdef ALLOW_NONHYDROSTATIC
133            OBWw(J,K,bi,bj)=-Uinflow            OBWw(J,K,bi,bj)=-Uinflow
134       & *sqrt(2.0*PI/obTimeScale*2.0*PI/obTimeScale - f0*f0)       & *sqrt(2.0 _d 0*PI/obTimeScale*2.0 _d 0*PI/obTimeScale - f0*f0)
135       & /sqrt(strat*strat - 2.0*PI/obTimeScale*2.0*PI/obTimeScale)       & /sqrt(strat*strat -
136       & *sin(mz*PI*(float(k)-0.5)/float(Nr))       &          2.0 _d 0*PI/obTimeScale*2.0 _d 0*PI/obTimeScale)
137       &       *cos(2.*PI*futureTime/obTimeScale)       & *sin(mz*PI*(float(k)-0.5 _d 0)/float(Nr))
138       &       *(exp(futureTime/rampTime2)       &       *cos(2. _d 0*PI*futureTime/obTimeScale)
139       &   - exp(-futureTime/rampTime2))  c    &       *(exp(futureTime/rampTime2)
140       &   /(exp(futureTime/rampTime2)  c    &   - exp(-futureTime/rampTime2))
141       &  + exp(-futureTime/rampTime2))  c    &   /(exp(futureTime/rampTime2)
142    c    &  + exp(-futureTime/rampTime2))
143  #endif  #endif
144            ENDDO            ENDDO
145          ENDDO          ENDDO

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.22