1 |
cnh |
1.4 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_salt.F,v 1.3 1998/06/09 18:57:38 cnh Exp $ |
2 |
cnh |
1.1 |
|
3 |
|
|
#include "CPP_EEOPTIONS.h" |
4 |
|
|
|
5 |
|
|
CStartOfInterface |
6 |
|
|
SUBROUTINE INI_SALT ( myThid ) |
7 |
|
|
C /==========================================================\ |
8 |
|
|
C | SUBROUTINE INI_SALT | |
9 |
|
|
C | o Set model initial salinity field. | |
10 |
|
|
C |==========================================================| |
11 |
|
|
C | There are several options for setting the initial | |
12 |
|
|
C | temperature file | |
13 |
|
|
C | 1. Inline code | |
14 |
|
|
C | 2. Vertical profile ( uniform S in X and Y ) | |
15 |
|
|
C | 3. Three-dimensional data from a file. For example from | |
16 |
|
|
C | Levitus or from a checkpoint file from a previous | |
17 |
|
|
C | integration. | |
18 |
|
|
C | In addition to setting the salinity field we also | |
19 |
|
|
C | set the initial salinity tendency term here. | |
20 |
|
|
C \==========================================================/ |
21 |
|
|
|
22 |
|
|
C === Global variables === |
23 |
|
|
#include "SIZE.h" |
24 |
|
|
#include "EEPARAMS.h" |
25 |
|
|
#include "PARAMS.h" |
26 |
|
|
#include "GRID.h" |
27 |
|
|
#include "DYNVARS.h" |
28 |
|
|
|
29 |
|
|
C == Routine arguments == |
30 |
|
|
C myThid - Number of this instance of INI_SALT |
31 |
|
|
INTEGER myThid |
32 |
|
|
CEndOfInterface |
33 |
|
|
|
34 |
|
|
C == Local variables == |
35 |
|
|
C iC, jC - Center of domain |
36 |
|
|
C iD, jD - Disitance from domain center. |
37 |
|
|
C rad - Radius of initial patch |
38 |
|
|
C rD - Radial displacement of point I,J |
39 |
|
|
C iG, jG - Global coordinate index |
40 |
|
|
C bi,bj - Loop counters |
41 |
|
|
C I,J,K |
42 |
|
|
INTEGER iC, jC, iD, jD |
43 |
|
|
INTEGER iG, jG |
44 |
|
|
INTEGER bi, bj |
45 |
|
|
INTEGER I, J, K |
46 |
|
|
REAL rad, rD |
47 |
|
|
|
48 |
cnh |
1.3 |
_BARRIER |
49 |
|
|
|
50 |
|
|
IF ( hydrogSaltFile .EQ. ' ' ) THEN |
51 |
|
|
C-- Initialise salinity field to the vertical reference profile |
52 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
53 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
54 |
|
|
DO K=1,Nz |
55 |
|
|
DO J=1,sNy |
56 |
|
|
DO I=1,sNx |
57 |
|
|
salt(I,J,K,bi,bj) = sRef(K) |
58 |
|
|
ENDDO |
59 |
cnh |
1.1 |
ENDDO |
60 |
|
|
ENDDO |
61 |
|
|
ENDDO |
62 |
|
|
ENDDO |
63 |
cnh |
1.3 |
ELSE |
64 |
|
|
_BEGIN_MASTER( myThid ) |
65 |
cnh |
1.4 |
CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid ) |
66 |
cnh |
1.3 |
_END_MASTER(myThid) |
67 |
|
|
ENDIF |
68 |
cnh |
1.1 |
C Set initial tendency terms |
69 |
|
|
DO bj = myByLo(myThid), myByHi(myThid) |
70 |
|
|
DO bi = myBxLo(myThid), myBxHi(myThid) |
71 |
|
|
DO K=1,Nz |
72 |
|
|
DO J=1,sNy |
73 |
|
|
DO I=1,sNx |
74 |
|
|
gs (I,J,K,bi,bj) = 0. _d 0 |
75 |
|
|
gsNM1(I,J,K,bi,bj) = 0. _d 0 |
76 |
|
|
ENDDO |
77 |
|
|
ENDDO |
78 |
|
|
ENDDO |
79 |
|
|
ENDDO |
80 |
|
|
ENDDO |
81 |
|
|
C |
82 |
|
|
_EXCH_XYZ_R8(salt , myThid ) |
83 |
|
|
_EXCH_XYZ_R8(gs , myThid ) |
84 |
|
|
_EXCH_XYZ_R8(gsNM1 , myThid ) |
85 |
|
|
RETURN |
86 |
|
|
END |