/[MITgcm]/MITgcm/verification/aim.5l_Equatorial_Channel/code/ini_depths.F
ViewVC logotype

Diff of /MITgcm/verification/aim.5l_Equatorial_Channel/code/ini_depths.F

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

revision 1.11 by jmc, Wed Oct 18 20:44:37 2006 UTC revision 1.13 by jmc, Tue Apr 28 18:06:14 2009 UTC
# Line 37  C     === Global variables === Line 37  C     === Global variables ===
37  #include "PARAMS.h"  #include "PARAMS.h"
38  #include "GRID.h"  #include "GRID.h"
39  #include "SURFACE.h"  #include "SURFACE.h"
40  #ifdef ALLOW_SHELFICE  #ifdef ALLOW_MNC
41  # include "SHELFICE.h"  # include "MNC_PARAMS.h"
42  #endif /* ALLOW_SHELFICE */  #endif
43    
44  C     !INPUT/OUTPUT PARAMETERS:  C     !INPUT/OUTPUT PARAMETERS:
45  C     == Routine arguments ==  C     == Routine arguments ==
# Line 79  C------ Line 79  C------
79            R_low(i,j,bi,bj)   = 0. _d 0            R_low(i,j,bi,bj)   = 0. _d 0
80            Ro_surf(i,j,bi,bj) = 0. _d 0            Ro_surf(i,j,bi,bj) = 0. _d 0
81            topoZ(i,j,bi,bj)   = 0. _d 0            topoZ(i,j,bi,bj)   = 0. _d 0
 #ifdef ALLOW_SHELFICE  
           R_shelfIce(i,j,bi,bj) = 0. _d 0  
 #endif /* ALLOW_SHELFICE */  
82           ENDDO           ENDDO
83          ENDDO          ENDDO
84         ENDDO         ENDDO
# Line 106  C-            ocean : R_low = Bottom Line 103  C-            ocean : R_low = Bottom
103          ENDDO          ENDDO
104         ENDDO         ENDDO
105        ELSE        ELSE
106    
107    #ifdef ALLOW_MNC
108            IF (useMNC .AND. mnc_read_bathy) THEN
109              CALL MNC_CW_ADD_VNAME('bathy', 'Cen_xy_Hn__-__-', 3,4, myThid)
110              CALL MNC_FILE_CLOSE_ALL_MATCHING(bathyFile, myThid)
111              CALL MNC_CW_SET_UDIM(bathyFile, 1, myThid)
112              CALL MNC_CW_SET_CITER(bathyFile, 2, -1, -1, -1, myThid)
113              CALL MNC_CW_SET_UDIM(bathyFile, 1, myThid)
114              CALL MNC_CW_RL_R('D',bathyFile,0,0,'bathy',R_low, myThid)
115              CALL MNC_FILE_CLOSE_ALL_MATCHING(bathyFile, myThid)
116              CALL MNC_CW_DEL_VNAME('bathy', myThid)
117            ELSE
118    #endif /*  ALLOW_MNC  */
119  C Read the bathymetry using the mid-level I/O package read_write_rec  C Read the bathymetry using the mid-level I/O package read_write_rec
120  C The 0 is the "iteration" argument. The 1 is the record number.  C The 0 is the "iteration" argument. The 1 is the record number.
121          CALL READ_REC_XY_RS( bathyFile, R_low, 1, 0, myThid )            CALL READ_REC_XY_RS( bathyFile, R_low, 1, 0, myThid )
122  C Read the bathymetry using the mid-level I/O package read_write_fld  C Read the bathymetry using the mid-level I/O package read_write_fld
123  C The 0 is the "iteration" argument. The ' ' is an empty suffix  C The 0 is the "iteration" argument. The ' ' is an empty suffix
124  c       CALL READ_FLD_XY_RS( bathyFile, ' ', R_low, 0, myThid )  c       CALL READ_FLD_XY_RS( bathyFile, ' ', R_low, 0, myThid )
125  C Read the bathymetry using the low-level I/O package  C Read the bathymetry using the low-level I/O package
126  c       CALL MDSREADFIELD( bathyFile, readBinaryPrec,  c       CALL MDSREADFIELD( bathyFile, readBinaryPrec,
127  c    &                     'RS', 1, R_low, 1, myThid )  c    &                     'RS', 1, R_low, 1, myThid )
128    
129    #ifdef ALLOW_MNC
130            ENDIF
131    #endif /*  ALLOW_MNC  */
132    
133    
134        ENDIF        ENDIF
135  C- end setup R_low in the interior  C- end setup R_low in the interior
136    
137  C- fill in the overlap (+ BARRIER):  C- fill in the overlap (+ BARRIER):
138        _EXCH_XY_R4(R_low, myThid )        _EXCH_XY_RS(R_low, myThid )
139    
140        IF ( debugLevel.GE.debLevB ) THEN        IF ( debugLevel.GE.debLevB ) THEN
141  c      PRINT *, ' Calling plot field', myThid  c      PRINT *, ' Calling plot field', myThid
# Line 146  C------ set default value: Line 162  C------ set default value:
162           DO bi = myBxLo(myThid), myBxHi(myThid)           DO bi = myBxLo(myThid), myBxHi(myThid)
163            DO j=1,sNy            DO j=1,sNy
164             DO i=1,sNx             DO i=1,sNx
165              Ro_surf(i,j,bi,bj) = Ro_SeaLevel              Ro_surf(i,j,bi,bj) = rF(1)
166             ENDDO             ENDDO
167            ENDDO            ENDDO
168           ENDDO           ENDDO
# Line 175  c         _BARRIER Line 191  c         _BARRIER
191  C         This I/O is now done in write_grid.F  C         This I/O is now done in write_grid.F
192  c         CALL WRITE_FLD_XY_RS( 'topo_P',' ',Ro_surf,0,myThid)  c         CALL WRITE_FLD_XY_RS( 'topo_P',' ',Ro_surf,0,myThid)
193    
194            ELSEIF ( buoyancyRelation.EQ.'OCEANICP' ) THEN
195    
196              WRITE(msgBuf,'(A,A)') 'S/R INI_DEPTHS: ',
197         &     'from topoFile (in m) to ref.bottom pressure: Not yet coded'
198              CALL PRINT_ERROR( msgBuf , myThid)
199              STOP 'ABNORMAL END: S/R INI_DEPTHS'
200    
201          ELSE          ELSE
202  C----  C----
203  C   Direct Transfer to Ro_surf (e.g., to specify upper ocean boundary  C   Direct Transfer to Ro_surf (e.g., to specify upper ocean boundary
# Line 195  C------ end case "read topoFile" Line 218  C------ end case "read topoFile"
218        ENDIF        ENDIF
219    
220  C----- fill in the overlap (+ BARRIER):  C----- fill in the overlap (+ BARRIER):
221        _EXCH_XY_R4(Ro_surf, myThid )        _EXCH_XY_RS(Ro_surf, myThid )
222    
223  c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
224    
# Line 215  C          Test for northern edge Line 238  C          Test for northern edge
238  c          IF ( jG .EQ. Ny )  Ro_surf(i,j,bi,bj) = 0.  c          IF ( jG .EQ. Ny )  Ro_surf(i,j,bi,bj) = 0.
239  c- Domain : Symetric % Eq. & closed at N & S boundaries:  c- Domain : Symetric % Eq. & closed at N & S boundaries:
240             IF (usingSphericalPolarGrid .AND.             IF (usingSphericalPolarGrid .AND.
241       &         ABS(yC(I,J,bi,bj)).GE.-phiMin)       &         ABS(yC(I,J,bi,bj)).GE.-ygOrigin)
242       &       Ro_surf(I,J,bi,bj) = rF(Nr+1)       &       Ro_surf(I,J,bi,bj) = rF(Nr+1)
243             IF (usingSphericalPolarGrid .AND. ABS(yC(I,J,bi,bj)).GE.90. )             IF (usingSphericalPolarGrid .AND. ABS(yC(I,J,bi,bj)).GE.90. )
244       &       Ro_surf(I,J,bi,bj) = rF(Nr+1)       &       Ro_surf(I,J,bi,bj) = rF(Nr+1)
# Line 236  C          Test for northern edge Line 259  C          Test for northern edge
259  c          IF ( jG .EQ. Ny )  R_low(i,j,bi,bj) = 0.  c          IF ( jG .EQ. Ny )  R_low(i,j,bi,bj) = 0.
260  c- Domain : Symetric % Eq. & closed at N & S boundaries:  c- Domain : Symetric % Eq. & closed at N & S boundaries:
261             IF (usingSphericalPolarGrid .AND.             IF (usingSphericalPolarGrid .AND.
262       &         ABS(yC(I,J,bi,bj)).GE.-phiMin)       &         ABS(yC(I,J,bi,bj)).GE.-ygOrigin)
263       &       R_low(I,J,bi,bj) = Ro_SeaLevel       &       R_low(I,J,bi,bj) = rF(1)
264             IF (usingSphericalPolarGrid .AND. ABS(yC(I,J,bi,bj)).GE.90. )             IF (usingSphericalPolarGrid .AND. ABS(yC(I,J,bi,bj)).GE.90. )
265       &       R_low(I,J,bi,bj) = Ro_SeaLevel       &       R_low(I,J,bi,bj) = rF(1)
266            ENDDO            ENDDO
267           ENDDO           ENDDO
268          ENDDO          ENDDO
# Line 253  c- Domain : Symetric % Eq. & closed at N Line 276  c- Domain : Symetric % Eq. & closed at N
276        ENDIF        ENDIF
277  c     CALL WRITE_FLD_XY_RS('Ro_surf',' ',Ro_surf,0,myThid)  c     CALL WRITE_FLD_XY_RS('Ro_surf',' ',Ro_surf,0,myThid)
278    
 #ifdef ALLOW_SHELFICE  
 c---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  
       IF ( useShelfIce ) THEN  
 C------  
 C   4) Set R_shelfIce = the Lower (in r sense) boundary of floating shelfice :  
 C------  
       IF (usingPCoords .OR. shelfIceFile .EQ. ' ') THEN  
 C- e.g., atmosphere : R_low = Top of atmosphere  
 C-            ocean : R_low = Bottom  
        DO bj = myByLo(myThid), myByHi(myThid)  
         DO bi = myBxLo(myThid), myBxHi(myThid)  
          DO j=1,sNy  
           DO i=1,sNx  
            R_shelfIce(i,j,bi,bj) = 0. _d 0  
           ENDDO  
          ENDDO  
         ENDDO  
        ENDDO  
       ELSE  
 C Read the shelfIce draught using the mid-level I/O pacakage read_write_rec  
 C The 0 is the "iteration" argument. The 1 is the record number.  
         CALL READ_REC_XY_RS( shelfIceFile, R_shelfIce, 1, 0, myThid )  
 C Read the shelfIce draught using the mid-level I/O pacakage read_write_fld  
 C The 0 is the "iteration" argument. The ' ' is an empty suffix  
 C        CALL READ_FLD_XY_RS( shelfIceFile, ' ', R_shelfIce, 0, myThid )  
 c       CALL READ_FLD_XY_RS( bathyFile, ' ', R_low, 0, myThid )  
 C Read the selfIce draught using the low-level I/O package  
 c       CALL MDSREADFIELD( shelfIceFile, readBinaryPrec,  
 c    &                     'RS', 1, R_selfIce, 1, myThid )  
   
       ENDIF  
 C- end setup R_shelfIce in the interior  
   
 C- fill in the overlap (+ BARRIER):  
       _EXCH_XY_R4(R_shelfIce, myThid )  
   
 c     CALL PLOT_FIELD_XYRS(R_selfIce,'Shelf ice draught (ini_depths)',  
 c    &     1,myThid)  
 CML      CALL WRITE_FLD_XY_RS( 'R_shelfIce' ,' ', R_shelfIce, 0,myThid)  
       ENDIF  
 #endif /* ALLOW_SHELFICE */  
   
279  C--   Everyone else must wait for the depth to be loaded  C--   Everyone else must wait for the depth to be loaded
280  C-    note: might not be necessary since all single-thread IO above  C-    note: might not be necessary since all single-thread IO above
281  C           are followed by an EXCH (with BARRIER)  C           are followed by an EXCH (with BARRIER)
282        _BARRIER        _BARRIER
283    
284    #ifdef ALLOW_OBCS
285          IF ( useOBCS ) THEN
286    C     check for inconsistent topography along boundaries and fix it
287           CALL OBCS_CHECK_DEPTHS( myThid )
288    C     update the overlaps
289           _EXCH_XY_RS(R_low, myThid )
290          ENDIF
291    #endif /* ALLOW_OBCS */
292    
293    #ifdef ALLOW_EXCH2
294    C     Check domain boundary (e.g., in case of missing tiles)
295          CALL EXCH2_CHECK_DEPTHS( R_low, Ro_surf, myThid )
296    #endif
297    
298        RETURN        RETURN
299        END        END

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22