/[MITgcm]/MITgcm/model/src/ini_vel.F
ViewVC logotype

Annotation of /MITgcm/model/src/ini_vel.F

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


Revision 1.4 - (hide annotations) (download)
Tue Aug 28 12:58:10 2001 UTC (22 years, 9 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint40pre9, checkpoint40
Changes since 1.3: +7 -7 lines
Bug fix: Moved exchange of (U,V) from end or s/r to before calculation of W.
Reported by Tor Eldvik.

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

  ViewVC Help
Powered by ViewVC 1.1.22