/[MITgcm]/MITgcm_contrib/natl_12/code/ini_salt.F
ViewVC logotype

Annotation of /MITgcm_contrib/natl_12/code/ini_salt.F

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


Revision 1.1 - (hide annotations) (download)
Tue Aug 5 21:22:43 2003 UTC (21 years, 11 months ago) by cnh
Branch: MAIN
CVS Tags: HEAD
Adding set of files for 1/12 Atlantic configuration

1 cnh 1.1 C $Header: /u/u0/gcmpack/MITgcm/model/src/ini_salt.F,v 1.14 2001/09/26 18:09:15 cnh Exp $
2     C $Name: $
3    
4     #include "CPP_OPTIONS.h"
5    
6     CBOP
7     C !ROUTINE: INI_SALT
8     C !INTERFACE:
9     SUBROUTINE INI_SALT ( myThid )
10     C !DESCRIPTION: \bv
11     C *==========================================================*
12     C | SUBROUTINE INI_SALT
13     C | o Set model initial salinity field.
14     C *==========================================================*
15     C | There are several options for setting the initial
16     C | temperature file
17     C | 1. Inline code
18     C | 2. Vertical profile ( uniform S in X and Y )
19     C | 3. Three-dimensional data from a file. For example from
20     C | Levitus or from a checkpoint file from a previous
21     C | integration.
22     C | In addition to setting the salinity field we also
23     C | set the initial salinity tendency term here.
24     C *==========================================================*
25     C \ev
26    
27     C !USES:
28     IMPLICIT NONE
29     C === Global variables ===
30     #include "SIZE.h"
31     #include "EEPARAMS.h"
32     #include "PARAMS.h"
33     #include "GRID.h"
34     #include "DYNVARS.h"
35     #include "FFIELDS.h"
36    
37     C !INPUT/OUTPUT PARAMETERS:
38     C == Routine arguments ==
39     C myThid - Number of this instance of INI_SALT
40     INTEGER myThid
41    
42     C !LOCAL VARIABLES:
43     C == Local variables ==
44     C bi,bj - Loop counters
45     C I,J,K
46     INTEGER bi, bj
47     INTEGER I, J, K, localWarnings
48     CHARACTER*(MAX_LEN_MBUF) msgBuf
49     CEOP
50    
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,Nr
55     DO J=1-Oly,sNy+Oly
56     DO I=1-Olx,sNx+Olx
57     salt(I,J,K,bi,bj) = sRef(K)
58     ENDDO
59     ENDDO
60     ENDDO
61     ENDDO
62     ENDDO
63    
64     IF ( hydrogSaltFile .NE. ' ' ) THEN
65     _BEGIN_MASTER( myThid )
66     CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid )
67     _END_MASTER(myThid)
68     _EXCH_XYZ_R8(salt , myThid )
69     ENDIF
70    
71     C Apply mask and test consistancy
72     localWarnings=0
73     DO bj = myByLo(myThid), myByHi(myThid)
74     DO bi = myBxLo(myThid), myBxHi(myThid)
75     DO K=1,Nr
76     DO J=1,sNy
77     DO I=1,sNx
78     IF (hFacC(I,J,K,bi,bj).EQ.0) salt(I,J,K,bi,bj) = 0.
79     IF (hFacC(I,J,K,bi,bj).NE.0.AND.salt(I,J,K,bi,bj).EQ.0.
80     & .AND. sRef(k).NE.0.) THEN
81     localWarnings=localWarnings+1
82     ENDIF
83     saltRef(i,j,k,bi,bj) = salt(i,j,k,bi,bj)
84     ENDDO
85     ENDDO
86     ENDDO
87     ENDDO
88     ENDDO
89     _EXCH_XYZ_R8(saltRef , myThid )
90     IF (localWarnings.NE.0) THEN
91     WRITE(msgBuf,'(A,A)')
92     & 'S/R INI_SALT: salt = 0 identically. If this is intentional',
93     & 'you will need to edit ini_salt.F to avoid this safety check'
94     CALL PRINT_ERROR( msgBuf , myThid)
95     STOP 'ABNORMAL END: S/R INI_SALT'
96     ENDIF
97    
98     CALL PLOT_FIELD_XYZRL( salt, 'Initial Salinity' , Nr, 1, myThid )
99    
100     RETURN
101     END

  ViewVC Help
Powered by ViewVC 1.1.22