File indexing completed on 2018-03-02 18:36:54 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
cc6ab98535 Jean*0001 #include "PACKAGES_CONFIG.h"
1dbaea09ee Chri*0002 #include "CPP_OPTIONS.h"
924557e60a Chri*0003
9366854e02 Chri*0004
0005
0006
c6cc710cc5 Jean*0007 SUBROUTINE INI_SALT( myThid )
7c20dc45c1 Jean*0008
9366854e02 Chri*0009
0010
cc6ab98535 Jean*0011
0012
9366854e02 Chri*0013
cc6ab98535 Jean*0014
0015
0016
0017
0018
0019
0020
0021
0022
9366854e02 Chri*0023
0024
924557e60a Chri*0025
9366854e02 Chri*0026
0027 IMPLICIT NONE
924557e60a Chri*0028
0029 #include "SIZE.h"
0030 #include "EEPARAMS.h"
0031 #include "PARAMS.h"
0032 #include "GRID.h"
0033 #include "DYNVARS.h"
5f4df5533c Ed H*0034 #ifdef ALLOW_MNC
0035 #include "MNC_PARAMS.h"
0036 #endif
924557e60a Chri*0037
9366854e02 Chri*0038
924557e60a Chri*0039
cc6ab98535 Jean*0040
924557e60a Chri*0041 INTEGER myThid
0042
9366854e02 Chri*0043
924557e60a Chri*0044
cc6ab98535 Jean*0045
4c5bb1c88e Jean*0046
924557e60a Chri*0047 INTEGER bi, bj
4c5bb1c88e Jean*0048 INTEGER i, j, k, localWarnings
aea29c8517 Alis*0049 CHARACTER*(MAX_LEN_MBUF) msgBuf
9366854e02 Chri*0050
924557e60a Chri*0051
aea29c8517 Alis*0052
0053 DO bj = myByLo(myThid), myByHi(myThid)
0054 DO bi = myBxLo(myThid), myBxHi(myThid)
4c5bb1c88e Jean*0055 DO k=1,Nr
522c728681 Jean*0056 DO j=1-OLy,sNy+OLy
0057 DO i=1-OLx,sNx+OLx
4c5bb1c88e Jean*0058 salt(i,j,k,bi,bj) = sRef(k)
924557e60a Chri*0059 ENDDO
0060 ENDDO
0061 ENDDO
0062 ENDDO
aea29c8517 Alis*0063 ENDDO
0064
0065 IF ( hydrogSaltFile .NE. ' ' ) THEN
5f4df5533c Ed H*0066 #ifdef ALLOW_MNC
cc6ab98535 Jean*0067 IF ( useMNC.AND.mnc_read_salt ) THEN
5f4df5533c Ed H*0068 CALL MNC_FILE_CLOSE_ALL_MATCHING(hydrogSaltFile, myThid)
0069 CALL MNC_CW_SET_UDIM(hydrogSaltFile, 1, myThid)
0070 CALL MNC_CW_SET_CITER(hydrogSaltFile, 2, -1, -1, -1, myThid)
0071 CALL MNC_CW_SET_UDIM(hydrogSaltFile, 1, myThid)
0072 CALL MNC_CW_RL_R('D',hydrogSaltFile,0,0,'S',salt, myThid)
0073 CALL MNC_FILE_CLOSE_ALL_MATCHING(hydrogSaltFile, myThid)
0074 ELSE
0075 #endif /* ALLOW_MNC */
c6cc710cc5 Jean*0076 CALL READ_FLD_XYZ_RL( hydrogSaltFile, ' ', salt, 0, myThid )
5f4df5533c Ed H*0077 #ifdef ALLOW_MNC
0078 ENDIF
0079 #endif /* ALLOW_MNC */
c6cc710cc5 Jean*0080 _EXCH_XYZ_RL( salt, myThid )
c1dd0647a3 Chri*0081 ENDIF
aea29c8517 Alis*0082
c6cc710cc5 Jean*0083
aea29c8517 Alis*0084 localWarnings=0
924557e60a Chri*0085 DO bj = myByLo(myThid), myByHi(myThid)
0086 DO bi = myBxLo(myThid), myBxHi(myThid)
4c5bb1c88e Jean*0087 DO k=1,Nr
0088 IF ( maskIniSalt ) THEN
522c728681 Jean*0089 DO j=1-OLy,sNy+OLy
0090 DO i=1-OLx,sNx+OLx
4c5bb1c88e Jean*0091 IF (maskC(i,j,k,bi,bj).EQ.0.) salt(i,j,k,bi,bj) = 0.
0092 ENDDO
924557e60a Chri*0093 ENDDO
4c5bb1c88e Jean*0094 ENDIF
459592f6e5 Jean*0095 IF ( sRef(k).NE.0. ) THEN
4c5bb1c88e Jean*0096 DO j=1,sNy
0097 DO i=1,sNx
0098 IF ( maskC(i,j,k,bi,bj).NE.0.
0099 & .AND. salt(i,j,k,bi,bj).EQ.0. ) THEN
459592f6e5 Jean*0100 localWarnings=localWarnings+1
0101 ENDIF
0102 ENDDO
0103 ENDDO
0104 ENDIF
924557e60a Chri*0105 ENDDO
0106 ENDDO
0107 ENDDO
4c5bb1c88e Jean*0108 IF ( localWarnings.NE.0 ) THEN
0109 IF ( checkIniSalt ) THEN
0110 WRITE(msgBuf,'(A,I10,A)')
0111 & ' INI_SALT: found', localWarnings,
0112 & ' wet grid-pts with salt=0 identically.'
0113 CALL PRINT_ERROR( msgBuf , myThid)
0114 WRITE(msgBuf,'(A,A)')
0115 & ' If this is intentional, you need to',
0116 & ' set checkIniSalt=.false. in "data", namelist PARM05'
0117 CALL PRINT_ERROR( msgBuf , myThid)
0118 STOP 'ABNORMAL END: S/R INI_SALT'
0119 ELSE
0120 WRITE(msgBuf,'(A,I10,A)')
0121 & '** WARNINGS ** INI_SALT: found', localWarnings,
0122 & ' wet grid-pts with salt=0 identically.'
0123 CALL PRINT_MESSAGE( msgBuf, errorMessageUnit,
0124 & SQUEEZE_RIGHT, myThid )
0125 ENDIF
aea29c8517 Alis*0126 ENDIF
42bd47f06f Chri*0127
522c728681 Jean*0128 IF ( plotLevel.GE.debLevC ) THEN
cc6ab98535 Jean*0129 CALL PLOT_FIELD_XYZRL( salt, 'Initial Salinity',
0130 & Nr, 1, myThid )
0131 ENDIF
42bd47f06f Chri*0132
924557e60a Chri*0133 RETURN
0134 END