1 |
C $Header: /u/gcmpack/MITgcm/model/src/ini_psurf.F,v 1.7 2003/10/30 12:00:41 edhill Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: INI_PSURF |
9 |
C !INTERFACE: |
10 |
SUBROUTINE INI_PSURF( myThid ) |
11 |
|
12 |
C !DESCRIPTION: \bv |
13 |
C *==========================================================* |
14 |
C | SUBROUTINE INI_PSURF | |
15 |
C | o Set model initial free-surface height/pressure. | |
16 |
C *==========================================================* |
17 |
C | There are several options for setting the initial | |
18 |
C | surface displacement (r unit) field. | |
19 |
C | 1. Inline code | |
20 |
C | 2. Two-dimensional data from a file. | |
21 |
C *==========================================================* |
22 |
C \ev |
23 |
|
24 |
C !USES: |
25 |
IMPLICIT NONE |
26 |
C === Global variables === |
27 |
#include "SIZE.h" |
28 |
#include "EEPARAMS.h" |
29 |
#include "PARAMS.h" |
30 |
#include "GRID.h" |
31 |
#include "DYNVARS.h" |
32 |
#include "SURFACE.h" |
33 |
#ifdef ALLOW_CD_CODE |
34 |
#include "CD_CODE_VARS.h" |
35 |
#endif |
36 |
|
37 |
C !INPUT/OUTPUT PARAMETERS: |
38 |
C == Routine arguments == |
39 |
C myThid - Number of this instance of INI_PSURF |
40 |
INTEGER myThid |
41 |
|
42 |
C !LOCAL VARIABLES: |
43 |
C == Local variables == |
44 |
C bi,bj - Loop counters |
45 |
C I,J |
46 |
INTEGER bi, bj |
47 |
INTEGER I, J |
48 |
CEOP |
49 |
|
50 |
C-- Initialise surface position anomaly to zero |
51 |
DO bj = myByLo(myThid), myByHi(myThid) |
52 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
53 |
DO J=1-Oly,sNy+Oly |
54 |
DO I=1-Olx,sNx+Olx |
55 |
etaN(I,J,bi,bj) = 0. _d 0 |
56 |
ENDDO |
57 |
ENDDO |
58 |
ENDDO |
59 |
ENDDO |
60 |
C Read an initial state |
61 |
IF (pSurfInitFile .NE. ' ') THEN |
62 |
_BEGIN_MASTER( myThid ) |
63 |
CALL READ_FLD_XY_RL( pSurfInitFile, ' ', etaN, 0, myThid ) |
64 |
_END_MASTER(myThid) |
65 |
ENDIF |
66 |
C |
67 |
_EXCH_XY_R8(etaN, myThid) |
68 |
|
69 |
#ifdef ALLOW_CD_CODE |
70 |
C-- By default, initialize etaNm1 with etaN : |
71 |
DO bj=myByLo(myThid),myByHi(myThid) |
72 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
73 |
DO J=1-Oly,sNy+Oly |
74 |
DO I=1-Olx,sNx+Olx |
75 |
etaNm1(I,J,bi,bj) = etaN(I,J,bi,bj) |
76 |
ENDDO |
77 |
ENDDO |
78 |
ENDDO |
79 |
ENDDO |
80 |
|
81 |
C _EXCH_XY_R8(etaNm1, myThid) |
82 |
#endif |
83 |
|
84 |
#ifdef EXACT_CONSERV |
85 |
C-- By default, initialize etaH with etaN : |
86 |
DO bj=myByLo(myThid),myByHi(myThid) |
87 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
88 |
DO j=1-Oly,sNy+Oly |
89 |
DO i=1-Olx,sNx+Olx |
90 |
etaH(i,j,bi,bj) = etaN(i,j,bi,bj) |
91 |
etaHnm1(i,j,bi,bj) = etaN(i,j,bi,bj) |
92 |
dEtaHdt(i,j,bi,bj) = 0. _d 0 |
93 |
ENDDO |
94 |
ENDDO |
95 |
ENDDO |
96 |
ENDDO |
97 |
#endif /* EXACT_CONSERV */ |
98 |
|
99 |
RETURN |
100 |
END |