1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_salt.F,v 1.9 1998/12/09 16:11:52 adcroft Exp $ |
2 |
|
3 |
#include "CPP_OPTIONS.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 |
IMPLICIT NONE |
22 |
|
23 |
C === Global variables === |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
#include "DYNVARS.h" |
29 |
|
30 |
C == Routine arguments == |
31 |
C myThid - Number of this instance of INI_SALT |
32 |
INTEGER myThid |
33 |
CEndOfInterface |
34 |
|
35 |
C == Local variables == |
36 |
C iC, jC - Center of domain |
37 |
C iD, jD - Disitance from domain center. |
38 |
C iG, jG - Global coordinate index |
39 |
C bi,bj - Loop counters |
40 |
C I,J,K |
41 |
INTEGER iC, jC, iD, jD |
42 |
INTEGER iG, jG |
43 |
INTEGER bi, bj |
44 |
INTEGER I, J, K |
45 |
|
46 |
_BARRIER |
47 |
|
48 |
IF ( hydrogSaltFile .EQ. ' ' ) THEN |
49 |
C-- Initialise salinity field to the vertical reference profile |
50 |
DO bj = myByLo(myThid), myByHi(myThid) |
51 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
52 |
DO K=1,Nr |
53 |
DO J=1,sNy |
54 |
DO I=1,sNx |
55 |
salt(I,J,K,bi,bj) = sRef(K) |
56 |
ENDDO |
57 |
ENDDO |
58 |
ENDDO |
59 |
ENDDO |
60 |
ENDDO |
61 |
ELSE |
62 |
_BEGIN_MASTER( myThid ) |
63 |
CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid ) |
64 |
_END_MASTER(myThid) |
65 |
ENDIF |
66 |
C Set initial tendency terms |
67 |
DO bj = myByLo(myThid), myByHi(myThid) |
68 |
DO bi = myBxLo(myThid), myBxHi(myThid) |
69 |
DO K=1,Nr |
70 |
DO J=1,sNy |
71 |
DO I=1,sNx |
72 |
gs (I,J,K,bi,bj) = 0. _d 0 |
73 |
gsNM1(I,J,K,bi,bj) = 0. _d 0 |
74 |
IF (hFacC(I,J,K,bi,bj).EQ.0) salt(I,J,K,bi,bj) = 0. |
75 |
ENDDO |
76 |
ENDDO |
77 |
ENDDO |
78 |
ENDDO |
79 |
ENDDO |
80 |
C |
81 |
_EXCH_XYZ_R8(salt , myThid ) |
82 |
_EXCH_XYZ_R8(gs , myThid ) |
83 |
_EXCH_XYZ_R8(gsNM1 , myThid ) |
84 |
|
85 |
CALL PLOT_FIELD_XYZRL( salt, 'Initial Salinity' , Nr, 1, myThid ) |
86 |
|
87 |
RETURN |
88 |
END |