/[MITgcm]/MITgcm/model/src/ini_salt.F
ViewVC logotype

Contents of /MITgcm/model/src/ini_salt.F

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


Revision 1.17 - (show annotations) (download)
Tue Nov 8 23:01:10 2005 UTC (20 years, 1 month ago) by cnh
Branch: MAIN
CVS Tags: checkpoint58b_post, checkpoint57y_post, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58n_post, checkpoint58k_post, checkpoint58l_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.16: +3 -3 lines
Removing gratuitous _BEGIN_MASTER statements so that singleCpuIO make work
multi-threaded.

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_salt.F,v 1.16 2005/11/07 18:26:02 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
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine arguments ==
38 C myThid - Number of this instance of INI_SALT
39 INTEGER myThid
40
41 C !LOCAL VARIABLES:
42 C == Local variables ==
43 C bi,bj - Loop counters
44 C I,J,K
45 INTEGER bi, bj
46 INTEGER I, J, K, localWarnings
47 CHARACTER*(MAX_LEN_MBUF) msgBuf
48 CEOP
49
50 C-- Initialise salinity field to the vertical reference profile
51 DO bj = myByLo(myThid), myByHi(myThid)
52 DO bi = myBxLo(myThid), myBxHi(myThid)
53 DO K=1,Nr
54 DO J=1-Oly,sNy+Oly
55 DO I=1-Olx,sNx+Olx
56 salt(I,J,K,bi,bj) = sRef(K)
57 ENDDO
58 ENDDO
59 ENDDO
60 ENDDO
61 ENDDO
62 _BARRIER
63
64 IF ( hydrogSaltFile .NE. ' ' ) THEN
65 C _BEGIN_MASTER( myThid )
66 CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid )
67 C _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-Oly,sNy+Oly
77 DO I=1-Olx,sNx+Olx
78 IF (maskC(I,J,K,bi,bj).EQ.0.) salt(I,J,K,bi,bj) = 0.
79 ENDDO
80 ENDDO
81 IF ( sRef(k).NE.0. ) THEN
82 DO J=1,sNy
83 DO I=1,sNx
84 IF ( maskC(I,J,K,bi,bj).NE.0.
85 & .AND. salt(I,J,K,bi,bj).EQ.0. ) THEN
86 localWarnings=localWarnings+1
87 ENDIF
88 ENDDO
89 ENDDO
90 ENDIF
91 ENDDO
92 ENDDO
93 ENDDO
94 IF (localWarnings.NE.0) THEN
95 WRITE(msgBuf,'(A,A)')
96 & 'S/R INI_SALT: salt = 0 identically. If this is intentional',
97 & 'you will need to edit ini_salt.F to avoid this safety check'
98 CALL PRINT_ERROR( msgBuf , myThid)
99 STOP 'ABNORMAL END: S/R INI_SALT'
100 ENDIF
101
102 CALL PLOT_FIELD_XYZRL( salt, 'Initial Salinity' , Nr, 1, myThid )
103
104 RETURN
105 END

  ViewVC Help
Powered by ViewVC 1.1.22