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

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

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


Revision 1.15 - (hide annotations) (download)
Fri Apr 15 22:07:29 2005 UTC (20 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57s_post, checkpoint57r_post, checkpoint57i_post, checkpoint57n_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57h_pre, checkpoint57h_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, checkpoint57h_done, checkpoint57j_post, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post
Changes since 1.14: +15 -9 lines
mask initial T & S also in halo regions (since not exchanged later)

1 jmc 1.15 C $Header: /u/gcmpack/MITgcm/model/src/ini_salt.F,v 1.14 2001/09/26 18:09:15 cnh Exp $
2 adcroft 1.13 C $Name: $
3 cnh 1.1
4 cnh 1.7 #include "CPP_OPTIONS.h"
5 cnh 1.1
6 cnh 1.14 CBOP
7     C !ROUTINE: INI_SALT
8     C !INTERFACE:
9 cnh 1.1 SUBROUTINE INI_SALT ( myThid )
10 cnh 1.14 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 adcroft 1.9 IMPLICIT NONE
29 cnh 1.1 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 cnh 1.14 C !INPUT/OUTPUT PARAMETERS:
37 cnh 1.1 C == Routine arguments ==
38     C myThid - Number of this instance of INI_SALT
39     INTEGER myThid
40    
41 cnh 1.14 C !LOCAL VARIABLES:
42 cnh 1.1 C == Local variables ==
43     C bi,bj - Loop counters
44     C I,J,K
45     INTEGER bi, bj
46 jmc 1.15 INTEGER I, J, K, localWarnings
47 adcroft 1.13 CHARACTER*(MAX_LEN_MBUF) msgBuf
48 cnh 1.14 CEOP
49 cnh 1.1
50 adcroft 1.13 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 cnh 1.1 ENDDO
58     ENDDO
59     ENDDO
60     ENDDO
61 adcroft 1.13 ENDDO
62    
63     IF ( hydrogSaltFile .NE. ' ' ) THEN
64 cnh 1.3 _BEGIN_MASTER( myThid )
65 cnh 1.4 CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid )
66 cnh 1.3 _END_MASTER(myThid)
67 adcroft 1.13 _EXCH_XYZ_R8(salt , myThid )
68 cnh 1.3 ENDIF
69 adcroft 1.13
70     C Apply mask and test consistancy
71     localWarnings=0
72 cnh 1.1 DO bj = myByLo(myThid), myByHi(myThid)
73     DO bi = myBxLo(myThid), myBxHi(myThid)
74 cnh 1.6 DO K=1,Nr
75 jmc 1.15 DO J=1-Oly,sNy+Oly
76     DO I=1-Olx,sNx+Olx
77     IF (maskC(I,J,K,bi,bj).EQ.0.) salt(I,J,K,bi,bj) = 0.
78     ENDDO
79     ENDDO
80     IF ( sRef(k).NE.0. ) THEN
81     DO J=1,sNy
82     DO I=1,sNx
83     IF ( maskC(I,J,K,bi,bj).NE.0.
84     & .AND. salt(I,J,K,bi,bj).EQ.0. ) THEN
85     localWarnings=localWarnings+1
86 adcroft 1.13 ENDIF
87 jmc 1.15 ENDDO
88 cnh 1.1 ENDDO
89 jmc 1.15 ENDIF
90 cnh 1.1 ENDDO
91     ENDDO
92     ENDDO
93 adcroft 1.13 IF (localWarnings.NE.0) THEN
94     WRITE(msgBuf,'(A,A)')
95     & 'S/R INI_SALT: salt = 0 identically. If this is intentional',
96     & 'you will need to edit ini_salt.F to avoid this safety check'
97     CALL PRINT_ERROR( msgBuf , myThid)
98     STOP 'ABNORMAL END: S/R INI_SALT'
99     ENDIF
100 cnh 1.5
101 cnh 1.6 CALL PLOT_FIELD_XYZRL( salt, 'Initial Salinity' , Nr, 1, myThid )
102 cnh 1.5
103 cnh 1.1 RETURN
104     END

  ViewVC Help
Powered by ViewVC 1.1.22