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

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

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

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

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.14

  ViewVC Help
Powered by ViewVC 1.1.22