/[MITgcm]/MITgcm/verification/solid-body.cs-32x32x1/code/ini_vel.F
ViewVC logotype

Contents of /MITgcm/verification/solid-body.cs-32x32x1/code/ini_vel.F

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


Revision 1.2 - (show annotations) (download)
Tue Feb 11 04:02:24 2003 UTC (18 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint57m_post, checkpoint52l_pre, checkpoint57g_pre, checkpoint50c_post, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint57g_post, checkpoint48e_post, checkpoint56b_post, checkpoint50c_pre, checkpoint57y_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint54d_post, checkpoint54e_post, checkpoint51l_post, checkpoint48i_post, checkpoint57r_post, 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, checkpoint51d_post, checkpoint51t_post, checkpoint58t_post, checkpoint51n_post, checkpoint55i_post, checkpoint58m_post, checkpoint57l_post, checkpoint52i_pre, checkpoint51s_post, checkpoint57t_post, checkpoint55c_post, checkpoint51j_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint53d_post, checkpoint60, checkpoint61, checkpoint57a_post, checkpoint57h_pre, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint58w_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint57y_pre, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint58o_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint58p_post, checkpoint58q_post, checkpoint52f_pre, checkpoint55d_post, checkpoint58e_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint50g_post, checkpoint57q_post, eckpoint57e_pre, 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, checkpoint50e_post, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint58g_post, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint52n_post, checkpoint53b_pre, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint51e_post, checkpoint57a_pre, checkpoint55a_post, checkpoint49, checkpoint57o_post, checkpoint51o_post, checkpoint57k_post, checkpoint51f_pre, checkpoint53b_post, checkpoint52a_post, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint51g_post, ecco_c52_e35, checkpoint57x_post, checkpoint50b_post, checkpoint58c_post, checkpoint58u_post, checkpoint51m_post, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint61g, checkpoint61d, checkpoint54c_post, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint51a_post, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint51p_post, checkpoint48g_post, checkpoint51u_post
Branch point for: branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
Changes since 1.1: +23 -15 lines
avoid out-of-bounds index

1 C $Header: /u/gcmpack/MITgcm/verification/solid-body.cs-32x32x1/code/ini_vel.F,v 1.1 2001/07/31 18:30:55 adcroft Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_VEL
8 C !INTERFACE:
9 SUBROUTINE INI_VEL( myThid )
10
11 C !DESCRIPTION: \bv
12 C *=================================================================
13 C | SUBROUTINE INI_VEL
14 C | o Initialize flow field (either to zero or from input files)
15 C *=================================================================
16 C \ev
17
18 C !USES:
19 IMPLICIT NONE
20 C === Global variables ===
21 #include "SIZE.h"
22 #include "EEPARAMS.h"
23 #include "PARAMS.h"
24 #include "GRID.h"
25 #include "DYNVARS.h"
26
27 C !INPUT/OUTPUT PARAMETERS:
28 C == Routine arguments ==
29 C myThid - Number of this instance of INI_VEL
30 INTEGER myThid
31
32 C == Local variables ==
33 C bi,bj,i,j,k - Loop counters
34 INTEGER bi,bj,i,j,k
35 INTEGER ip1,jp1
36 _RL psi,omegaprime,fac
37
38 psi(i,j,bi,bj)=fac*fCoriG(i,j,bi,bj)
39
40 C-- Initialise velocity fields to zero
41 C
42 C If you want to specify an analytic initial state for the flow
43 C field then customize the following section of code.
44 C It is, however, often easier to generate initial conditions
45 C off-line and read them from input files...
46 C
47 omegaprime=38.60328935834681d0/rSphere
48 fac=-(rSphere**2)*omegaprime/(2.d0*Omega)
49 DO bj = myByLo(myThid), myByHi(myThid)
50 DO bi = myBxLo(myThid), myBxHi(myThid)
51 DO k=1,Nr
52 DO j=1-Oly,sNy+Oly
53 jp1=MIN(j+1,sNy+Oly)
54 DO i=1-Olx,sNx+Olx
55 ip1=MIN(i+1,sNx+Olx)
56 uVel(i,j,k,bi,bj)=0.
57 & +(psi(i,j,bi,bj)-psi(i,jp1,bi,bj))*recip_dyg(i,j,bi,bj)
58 vVel(i,j,k,bi,bj)=0.
59 & +(psi(ip1,j,bi,bj)-psi(i,j,bi,bj))*recip_dxg(i,j,bi,bj)
60 wVel(i,j,k,bi,bj)=0.
61 ENDDO
62 ENDDO
63 ENDDO
64 ENDDO
65 ENDDO
66
67 C Read an initial state for each component if required
68 IF (uVelInitFile .NE. ' ') THEN
69 _BEGIN_MASTER( myThid )
70 CALL READ_FLD_XYZ_RL( uVelInitFile, ' ', uVel, 0, myThid )
71 _END_MASTER(myThid)
72 c _EXCH_XYZ_R8(uVel , myThid )
73 ENDIF
74
75 IF (vVelInitFile .NE. ' ') THEN
76 _BEGIN_MASTER( myThid )
77 CALL READ_FLD_XYZ_RL( vVelInitFile, ' ', vVel, 0, myThid )
78 _END_MASTER(myThid)
79 c _EXCH_XYZ_R8(vVel , myThid )
80 ENDIF
81
82 c IF (uVelInitFile .NE. ' ' .OR. vVelInitFile .NE. ' ') THEN
83 CALL EXCH_UV_XYZ_RL(uVel,vVel,.TRUE.,myThid)
84 c ENDIF
85
86 DO bj = myByLo(myThid), myByHi(myThid)
87 DO bi = myBxLo(myThid), myBxHi(myThid)
88 DO k=1,Nr
89 DO j=1-Oly,sNy+Oly
90 DO i=1-Olx,sNx+Olx
91 uVel(i,j,k,bi,bj)=uVel(i,j,k,bi,bj)*_maskW(i,j,k,bi,bj)
92 vVel(i,j,k,bi,bj)=vVel(i,j,k,bi,bj)*_maskS(i,j,k,bi,bj)
93 ENDDO
94 ENDDO
95 ENDDO
96 ENDDO
97 ENDDO
98
99 RETURN
100 END

  ViewVC Help
Powered by ViewVC 1.1.22