1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_psurf.F,v 1.3 2001/03/06 16:51:02 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CStartOfInterface |
7 |
SUBROUTINE INI_PSURF( myThid ) |
8 |
C /==========================================================\ |
9 |
C | SUBROUTINE INI_PSURF | |
10 |
C | o Set model initial free-surface height/pressure. | |
11 |
C |==========================================================| |
12 |
C | There are several options for setting the initial | |
13 |
C | surface displacement (r unit) field. | |
14 |
C | 1. Inline code | |
15 |
C | 2. Two-dimensional data from a file. | |
16 |
C \==========================================================/ |
17 |
IMPLICIT NONE |
18 |
|
19 |
C === Global variables === |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
#include "GRID.h" |
24 |
#include "DYNVARS.h" |
25 |
|
26 |
C == Routine arguments == |
27 |
C myThid - Number of this instance of INI_PSURF |
28 |
INTEGER myThid |
29 |
CEndOfInterface |
30 |
|
31 |
C == Local variables == |
32 |
C bi,bj - Loop counters |
33 |
C I,J |
34 |
INTEGER bi, bj |
35 |
INTEGER I, J |
36 |
_RL omegaprime,fac |
37 |
|
38 |
C-- Initialise surface position anomaly to zero |
39 |
omegaprime=38.60328935834681d0/rSphere |
40 |
fac=-(rSphere**2)*omegaprime*(Omega+omegaprime)/(4.d0*(Omega**2)) |
41 |
DO bj = myByLo(myThid), myByHi(myThid) |
42 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
43 |
DO J=1-Oly,sNy+Oly |
44 |
DO I=1-Olx,sNx+Olx |
45 |
etaN(I,J,bi,bj) = 0. +fac*(fCori(i,j,bi,bj)**2) |
46 |
ENDDO |
47 |
ENDDO |
48 |
ENDDO |
49 |
ENDDO |
50 |
C Read an initial state |
51 |
IF (pSurfInitFile .NE. ' ') THEN |
52 |
_BEGIN_MASTER( myThid ) |
53 |
CALL READ_FLD_XY_RL( pSurfInitFile, ' ', etaN, 0, myThid ) |
54 |
_END_MASTER(myThid) |
55 |
ENDIF |
56 |
C |
57 |
_EXCH_XY_R8(etaN, myThid) |
58 |
|
59 |
#ifdef INCLUDE_CD_CODE |
60 |
C-- By default, initialize etaNm1 with etaN : |
61 |
DO bj=myByLo(myThid),myByHi(myThid) |
62 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
63 |
DO J=1-Oly,sNy+Oly |
64 |
DO I=1-Olx,sNx+Olx |
65 |
etaNm1(I,J,bi,bj) = etaN(I,J,bi,bj) |
66 |
ENDDO |
67 |
ENDDO |
68 |
ENDDO |
69 |
ENDDO |
70 |
|
71 |
C _EXCH_XY_R8(etaNm1, myThid) |
72 |
#endif |
73 |
|
74 |
RETURN |
75 |
END |