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

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

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


Revision 1.5 - (show annotations) (download)
Wed Aug 7 16:55:52 2002 UTC (21 years, 8 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint46n_post, checkpoint51k_post, checkpoint47e_post, checkpoint57m_post, checkpoint52l_pre, checkpoint46l_post, checkpoint57g_pre, checkpoint46g_pre, checkpoint47c_post, checkpoint50c_post, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint46f_post, checkpoint57g_post, checkpoint48e_post, checkpoint56b_post, checkpoint50c_pre, checkpoint57y_post, checkpoint46b_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint48i_post, checkpoint57r_post, checkpoint46l_pre, checkpoint57d_post, checkpoint57i_post, checkpoint50d_pre, checkpoint52k_post, checkpoint59, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint58f_post, checkpoint52f_post, checkpoint58d_post, checkpoint58a_post, checkpoint50b_pre, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint58y_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint58t_post, checkpoint51n_post, checkpoint55i_post, checkpoint58m_post, checkpoint57l_post, checkpoint52i_pre, checkpoint51s_post, checkpoint47a_post, checkpoint57t_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint53d_post, checkpoint46d_pre, checkpoint60, checkpoint61, checkpoint57a_post, checkpoint48d_post, checkpoint57h_pre, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint46j_pre, checkpoint58w_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint57y_pre, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint46j_post, checkpoint51h_pre, checkpoint46k_post, checkpoint58o_post, checkpoint48a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint58p_post, checkpoint58q_post, checkpoint52f_pre, checkpoint55d_post, checkpoint58e_post, checkpoint47j_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint54a_post, checkpoint46e_pre, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint48c_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint46c_pre, checkpoint53a_post, checkpoint47b_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint46h_pre, checkpoint52d_post, checkpoint53g_post, checkpoint46m_post, checkpoint57p_post, checkpint57u_post, checkpoint50g_post, checkpoint57q_post, eckpoint57e_pre, checkpoint46g_post, checkpoint58k_post, checkpoint52a_pre, checkpoint58v_post, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint56a_post, checkpoint58l_post, checkpoint53f_post, checkpoint57h_done, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, checkpoint46i_post, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint46c_post, checkpoint58g_post, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint61n, checkpoint52n_post, checkpoint53b_pre, checkpoint46e_post, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint51e_post, checkpoint57a_pre, checkpoint55a_post, checkpoint47, checkpoint48, checkpoint49, checkpoint57o_post, checkpoint46h_post, checkpoint51o_post, checkpoint61q, checkpoint57k_post, checkpoint51f_pre, checkpoint61z, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint51g_post, ecco_c52_e35, checkpoint57x_post, checkpoint46d_post, checkpoint50b_post, checkpoint58c_post, checkpoint58u_post, checkpoint51m_post, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint61g, checkpoint61d, checkpoint54c_post, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint51a_post, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint51p_post, checkpoint48g_post, checkpoint61x, checkpoint61y, checkpoint51u_post
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.4: +2 -1 lines
o Added new equation of state -> JMD95Z and JMD95P
  - EOS of Jackett and McDougall, 1995, JPO
  - moved all EOS parameters into EOS.h
  - new routines ini_eos.F, store_pressure.F
o Added UNESCO EOS, but not recommended because it requires
  in-situ temperature (see JMD95)
o Modified formatting for knudsen2.f in utils/knudsen2 and added
  unesco.f to be used with POLY3

1 C $Header: /u/gcmpack/MITgcm/verification/internal_wave/code/obcs_calc.F,v 1.4 2002/04/06 01:33:42 jmc Exp $
2 C $Name: $
3
4 #include "OBCS_OPTIONS.h"
5
6 SUBROUTINE OBCS_CALC( bi, bj, futureTime, futureIter,
7 & uVel, vVel, wVel, theta, salt,
8 & myThid )
9 C /==========================================================\
10 C | SUBROUTINE OBCS_CALC |
11 C | o Calculate future boundary data at open boundaries |
12 C | at time = futureTime |
13 C |==========================================================|
14 C | |
15 C \==========================================================/
16 IMPLICIT NONE
17
18 C === Global variables ===
19 #include "SIZE.h"
20 #include "EEPARAMS.h"
21 #include "PARAMS.h"
22 #include "EOS.h"
23 #include "OBCS.h"
24
25 C == Routine arguments ==
26 INTEGER bi, bj
27 INTEGER futureIter
28 _RL futureTime
29 _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)
31 _RL wVel (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
32 _RL theta(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
33 _RL salt (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
34 INTEGER myThid
35
36 #ifdef ALLOW_OBCS
37
38 C == Local variables ==
39 INTEGER I, J ,K
40
41 #include "GRID.h"
42 _RL obTimeScale,Uinflow,rampTime2
43 _RL vertStructWst(Nr)
44 _RL mz,strat,kx
45 _RL tmpsum
46
47 C Vertical mode number
48 mz=1.0 _d 0
49 C Stratification
50 strat = 1.0 _d -6 / (gravity*tAlpha)
51
52 C Create a vertical structure function with zero mean
53 tmpsum=0.
54 do K=1,Nr
55 vertStructWst(K)=cos(mz*PI* (rC(K)/rF(Nr+1)) )
56 tmpsum=tmpsum+vertStructWst(K)*drF(K)
57 enddo
58 tmpsum=tmpsum/rF(Nr+1)
59 do K=1,Nr
60 vertStructWst(K)=vertStructWst(K)-tmpsum
61 enddo
62 c
63 obTimeScale = 44567.0 _d 0
64 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
67 & - 2.0 _d 0*pi*2.0 _d 0*pi/(obTimeScale*obTimeScale)))
68 Uinflow = 0.024 _d 0
69 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
76 IF (useOrlanskiEast) THEN
77 CALL ORLANSKI_EAST(
78 & bi, bj, futureTime,
79 & uVel, vVel, wVel, theta, salt,
80 & myThid )
81 ELSE
82 DO K=1,Nr
83 DO J=1-Oly,sNy+Oly
84 OBEu(J,K,bi,bj)=0.
85 OBEv(J,K,bi,bj)=0.
86 OBEt(J,K,bi,bj)=tRef(K)
87 OBEs(J,K,bi,bj)=sRef(K)
88 #ifdef ALLOW_NONHYDROSTATIC
89 OBEw(J,K,bi,bj)=0.
90 #endif
91 ENDDO
92 ENDDO
93 ENDIF
94
95 C Western OB
96 IF (useOrlanskiWest) THEN
97 CALL ORLANSKI_WEST(
98 & bi, bj, futureTime,
99 & uVel, vVel, wVel, theta, salt,
100 & myThid )
101 ELSE
102 DO K=1,Nr
103 DO J=1-Oly,sNy+Oly
104 OBWu(J,K,bi,bj)=0. _d 0
105 & +Uinflow
106 & *vertStructWst(K)
107 & *sin(2. _d 0*PI*futureTime/obTimeScale)
108 c & *(exp(futureTime/rampTime2)
109 c & - exp(-futureTime/rampTime2))
110 c & /(exp(futureTime/rampTime2)
111 c & + exp(-futureTime/rampTime2))
112 & *cos(kx*(3. _d 0-2. _d 0-0.5 _d 0)*delX(1))
113 OBWv(J,K,bi,bj)=0. _d 0
114 & +Uinflow
115 & *f0/(2.0 _d 0*PI/obTimeScale)
116 & *vertStructWst(K)
117 & *cos(2. _d 0*PI*futureTime/obTimeScale )
118 & * (exp(futureTime/rampTime2)
119 & - exp(-futureTime/rampTime2))
120 & /(exp(futureTime/rampTime2)
121 & + exp(-futureTime/rampTime2))
122 OBWt(J,K,bi,bj)=tRef(K)
123 & + Uinflow*sin(mz*PI*(float(k)-0.5 _d 0)/float(Nr))
124 & * sin(2.0 _d 0*PI*futureTime/obTimeScale)
125 & *sqrt(strat/(tAlpha*gravity))
126 & *sqrt(2.0 _d 0*PI/obTimeScale*2.0*PI/obTimeScale - f0*f0)
127 & /(2.0 _d 0*PI/obTimeScale)
128 c & * (exp(futureTime/rampTime2)
129 c & - exp(-futureTime/rampTime2))
130 c & /(exp(futureTime/rampTime2)
131 c & + exp(-futureTime/rampTime2))
132 #ifdef ALLOW_NONHYDROSTATIC
133 OBWw(J,K,bi,bj)=-Uinflow
134 & *sqrt(2.0 _d 0*PI/obTimeScale*2.0 _d 0*PI/obTimeScale - f0*f0)
135 & /sqrt(strat*strat -
136 & 2.0 _d 0*PI/obTimeScale*2.0 _d 0*PI/obTimeScale)
137 & *sin(mz*PI*(float(k)-0.5 _d 0)/float(Nr))
138 & *cos(2. _d 0*PI*futureTime/obTimeScale)
139 c & *(exp(futureTime/rampTime2)
140 c & - exp(-futureTime/rampTime2))
141 c & /(exp(futureTime/rampTime2)
142 c & + exp(-futureTime/rampTime2))
143 #endif
144 ENDDO
145 ENDDO
146 ENDIF
147
148 C Northern OB, template for forcing
149 IF (useOrlanskiNorth) THEN
150 CALL ORLANSKI_NORTH(
151 & bi, bj, futureTime,
152 & uVel, vVel, wVel, theta, salt,
153 & myThid )
154 ELSE
155 DO K=1,Nr
156 DO I=1-Olx,sNx+Olx
157 OBNv(I,K,bi,bj)=0.
158 OBNu(I,K,bi,bj)=0.
159 OBNt(I,K,bi,bj)=tRef(K)
160 OBNs(I,K,bi,bj)=sRef(K)
161 #ifdef ALLOW_NONHYDROSTATIC
162 OBNw(I,K,bi,bj)=0.
163 #endif
164 ENDDO
165 ENDDO
166 ENDIF
167
168 C Southern OB, template for forcing
169 IF (useOrlanskiSouth) THEN
170 CALL ORLANSKI_SOUTH(
171 & bi, bj, futureTime,
172 & uVel, vVel, wVel, theta, salt,
173 & myThid )
174 ELSE
175 DO K=1,Nr
176 DO I=1-Olx,sNx+Olx
177 OBSu(I,K,bi,bj)=0.
178 OBSv(I,K,bi,bj)=0.
179 OBSt(I,K,bi,bj)=tRef(K)
180 OBSs(I,K,bi,bj)=sRef(K)
181 #ifdef ALLOW_NONHYDROSTATIC
182 OBSw(I,K,bi,bj)=0.
183 #endif
184 ENDDO
185 ENDDO
186 ENDIF
187
188 #endif /* ALLOW_OBCS */
189 RETURN
190 END

  ViewVC Help
Powered by ViewVC 1.1.22