1 |
cnh |
1.5 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_vel.F,v 1.4 2001/08/28 12:58:10 adcroft Exp $ |
2 |
adcroft |
1.4 |
C $Name: $ |
3 |
adcroft |
1.2 |
|
4 |
|
|
#include "CPP_OPTIONS.h" |
5 |
|
|
|
6 |
cnh |
1.5 |
CBOP |
7 |
|
|
C !ROUTINE: INI_VEL |
8 |
|
|
C !INTERFACE: |
9 |
adcroft |
1.2 |
SUBROUTINE INI_VEL( myThid ) |
10 |
|
|
|
11 |
cnh |
1.5 |
C !DESCRIPTION: \bv |
12 |
|
|
C *================================================================= |
13 |
|
|
C | SUBROUTINE INI_VEL |
14 |
|
|
C | o Initialize 3D flow field (either to zero or from input files) |
15 |
|
|
C *================================================================= |
16 |
|
|
C \ev |
17 |
adcroft |
1.2 |
|
18 |
cnh |
1.5 |
C !USES: |
19 |
|
|
IMPLICIT NONE |
20 |
adcroft |
1.2 |
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 |
cnh |
1.5 |
C !INPUT/OUTPUT PARAMETERS: |
28 |
adcroft |
1.2 |
C == Routine arguments == |
29 |
|
|
C myThid - Number of this instance of INI_UVEL |
30 |
|
|
INTEGER myThid |
31 |
|
|
|
32 |
cnh |
1.5 |
C !LOCAL VARIABLES: |
33 |
adcroft |
1.2 |
C == Local variables == |
34 |
|
|
C bi,bj,i,j,k - Loop counters |
35 |
|
|
INTEGER bi,bj,i,j,k |
36 |
cnh |
1.5 |
CEOP |
37 |
adcroft |
1.2 |
|
38 |
|
|
C-- Initialise velocity fields to zero |
39 |
|
|
C |
40 |
|
|
C If you want to specify an analytic initial state for the flow |
41 |
|
|
C field then customize the following section of code. |
42 |
|
|
C It is, however, often easier to generate initial conditions |
43 |
|
|
C off-line and read them from input files... |
44 |
|
|
C |
45 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
46 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
47 |
|
|
DO k=1,Nr |
48 |
|
|
DO j=1-Oly,sNy+Oly |
49 |
|
|
DO i=1-Olx,sNx+Olx |
50 |
heimbach |
1.3 |
uVel(i,j,k,bi,bj)=0. _d 0 |
51 |
|
|
vVel(i,j,k,bi,bj)=0. _d 0 |
52 |
|
|
wVel(i,j,k,bi,bj)=0. _d 0 |
53 |
adcroft |
1.2 |
ENDDO |
54 |
|
|
ENDDO |
55 |
|
|
ENDDO |
56 |
|
|
ENDDO |
57 |
|
|
ENDDO |
58 |
|
|
|
59 |
|
|
C Read an initial state for each component if required |
60 |
|
|
IF (uVelInitFile .NE. ' ') THEN |
61 |
|
|
_BEGIN_MASTER( myThid ) |
62 |
|
|
CALL READ_FLD_XYZ_RL( uVelInitFile, ' ', uVel, 0, myThid ) |
63 |
|
|
_END_MASTER(myThid) |
64 |
|
|
c _EXCH_XYZ_R8(uVel , myThid ) |
65 |
|
|
ENDIF |
66 |
|
|
|
67 |
|
|
IF (vVelInitFile .NE. ' ') THEN |
68 |
|
|
_BEGIN_MASTER( myThid ) |
69 |
|
|
CALL READ_FLD_XYZ_RL( vVelInitFile, ' ', vVel, 0, myThid ) |
70 |
|
|
_END_MASTER(myThid) |
71 |
|
|
c _EXCH_XYZ_R8(vVel , myThid ) |
72 |
|
|
ENDIF |
73 |
|
|
|
74 |
adcroft |
1.4 |
c IF (uVelInitFile .NE. ' ' .OR. vVelInitFile .NE. ' ') THEN |
75 |
|
|
CALL EXCH_UV_XYZ_RL(uVel,vVel,.TRUE.,myThid) |
76 |
|
|
_EXCH_XYZ_R8(wVel,myThid) |
77 |
|
|
c ENDIF |
78 |
|
|
|
79 |
adcroft |
1.2 |
DO bj = myByLo(myThid), myByHi(myThid) |
80 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
81 |
|
|
DO k=1,Nr |
82 |
|
|
DO j=1-Oly,sNy+Oly |
83 |
|
|
DO i=1-Olx,sNx+Olx |
84 |
|
|
uVel(i,j,k,bi,bj)=uVel(i,j,k,bi,bj)*_maskW(i,j,k,bi,bj) |
85 |
|
|
vVel(i,j,k,bi,bj)=vVel(i,j,k,bi,bj)*_maskS(i,j,k,bi,bj) |
86 |
|
|
ENDDO |
87 |
|
|
ENDDO |
88 |
|
|
CALL INTEGRATE_FOR_W( |
89 |
|
|
I bi, bj, k, uVel, vVel, |
90 |
|
|
O wVel, |
91 |
|
|
I myThid ) |
92 |
|
|
ENDDO |
93 |
|
|
ENDDO |
94 |
|
|
ENDDO |
95 |
|
|
|
96 |
|
|
RETURN |
97 |
|
|
END |