/[MITgcm]/MITgcm_contrib/rpa_layers/layers/layers_init_fixed.F
ViewVC logotype

Diff of /MITgcm_contrib/rpa_layers/layers/layers_init_fixed.F

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

revision 1.1 by rpa, Tue Sep 15 19:16:53 2009 UTC revision 1.2 by jmc, Wed Sep 16 18:04:49 2009 UTC
# Line 1  Line 1 
1    C $Header$
2    C $Name$
3    
4  #include "LAYERS_OPTIONS.h"  #include "LAYERS_OPTIONS.h"
5    
6  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
# Line 33  C     msgBuf   :: Informational/error me Line 36  C     msgBuf   :: Informational/error me
36        _RL     Zc(Nr)        _RL     Zc(Nr)
37        _RL     ZZf(FineGridMax+1)        _RL     ZZf(FineGridMax+1)
38        _RL     ZZc(FineGridMax)        _RL     ZZc(FineGridMax)
39          
40        CHARACTER*(MAX_LEN_MBUF) msgBuf        CHARACTER*(MAX_LEN_MBUF) msgBuf
41    
42  #ifdef ALLOW_MNC  #ifdef ALLOW_MNC
# Line 69  C     calculate dZZ based on depth Line 72  C     calculate dZZ based on depth
72  C     create ZZ  C     create ZZ
73        ZZf(1) = 0. _d 0        ZZf(1) = 0. _d 0
74        ZZc(1) = 0.5 _d 0 * dZZ        ZZc(1) = 0.5 _d 0 * dZZ
75          
76        DO kk=2,NZZ        DO kk=2,NZZ
77              ZZf(kk) = ZZf(kk-1) + dZZ              ZZf(kk) = ZZf(kk-1) + dZZ
78              ZZc(kk) = ZZc(kk-1) + dZZ              ZZc(kk) = ZZc(kk-1) + dZZ
# Line 88  C       see if ZZc point is greater than Line 91  C       see if ZZc point is greater than
91            MapIndex(kk) = Nr - 1            MapIndex(kk) = Nr - 1
92            MapFact(kk) = 0.0 _d 0            MapFact(kk) = 0.0 _d 0
93  C       Otherwise we are somewhere in between and need to do interpolation)  C       Otherwise we are somewhere in between and need to do interpolation)
94          ELSE IF ( (ZZc(kk) .GE. Zc(k))          ELSE IF ( (ZZc(kk) .GE. Zc(k))
95       &   .AND. (ZZc(kk) .LT. Zc(Nr)) ) THEN       &   .AND. (ZZc(kk) .LT. Zc(Nr)) ) THEN
96  C         Find the proper k value  C         Find the proper k value
97            DO WHILE (ZZc(kk) .GE. Zc(k+1))            DO WHILE (ZZc(kk) .GE. Zc(k+1))
# Line 105  C       This means there was a problem Line 108  C       This means there was a problem
108            CALL PRINT_ERROR( msgBuf, myThid )            CALL PRINT_ERROR( msgBuf, myThid )
109            STOP 'ABNORMAL END: S/R LAYERS_INIT_FIXED'            STOP 'ABNORMAL END: S/R LAYERS_INIT_FIXED'
110          END IF          END IF
111            
112  C       See which grid box the point lies in  C       See which grid box the point lies in
113          IF (ZZc(kk) < Zf(MapIndex(kk)+1)) THEN          IF (ZZc(kk) < Zf(MapIndex(kk)+1)) THEN
114            CellIndex(kk) = MapIndex(kk)            CellIndex(kk) = MapIndex(kk)
115          ELSE          ELSE
116            CellIndex(kk) = MapIndex(kk)+1            CellIndex(kk) = MapIndex(kk)+1
117          END IF                  END IF
118        ENDDO        ENDDO
119    
120        IF (debugLevel .GT. 0) THEN        IF (debugLevel .GT. 0) THEN

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.22