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

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

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


Revision 1.15 - (hide annotations) (download)
Tue Oct 17 18:52:34 2006 UTC (17 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58q_post, checkpoint58r_post
Changes since 1.14: +6 -1 lines
clean-up multi-threaded problems (reported by debugger tcheck on ACES).

1 jmc 1.15 C $Header: /u/gcmpack/MITgcm/model/src/ini_vertical_grid.F,v 1.14 2005/06/22 00:25:32 jmc Exp $
2 cnh 1.12 C $Name: $
3 adcroft 1.1
4 cnh 1.7 #include "CPP_OPTIONS.h"
5 adcroft 1.1
6 cnh 1.12 CBOP
7     C !ROUTINE: INI_VERTICAL_GRID
8     C !INTERFACE:
9 adcroft 1.1 SUBROUTINE INI_VERTICAL_GRID( myThid )
10 cnh 1.12 C !DESCRIPTION: \bv
11     C *==========================================================*
12     C | SUBROUTINE INI_VERTICAL_GRID
13     C | o Initialise vertical gridding arrays
14     C *==========================================================*
15     C \ev
16    
17     C !USES:
18 adcroft 1.8 IMPLICIT NONE
19 adcroft 1.1 C === Global variables ===
20     #include "SIZE.h"
21     #include "EEPARAMS.h"
22     #include "PARAMS.h"
23     #include "GRID.h"
24    
25 cnh 1.12 C !INPUT/OUTPUT PARAMETERS:
26 adcroft 1.1 C == Routine arguments ==
27     C myThid - Number of this instance of INI_DEPTHS
28     INTEGER myThid
29    
30 cnh 1.12 C !LOCAL VARIABLES:
31 adcroft 1.1 C == Local variables ==
32 jmc 1.13 C K :: loop index
33     C msgBuf :: Informational/error meesage buffer
34 adcroft 1.1 INTEGER K
35 jmc 1.13 CHARACTER*(MAX_LEN_MBUF) msgBuf
36 cnh 1.12 CEOP
37 adcroft 1.1
38 jmc 1.15 _BEGIN_MASTER(myThid)
39    
40 jmc 1.13 IF (setCenterDr) THEN
41     C-- Interface at middle between 2 centers :
42    
43     C- Check that all thickness are > 0 :
44     DO K=1,Nr+1
45     IF (delRc(K).LE.0.) THEN
46     WRITE(msgBuf,'(A,I4,A,E16.8)')
47     & 'S/R INI_VERTICAL_GRID: delRc(K=',K,' )=',delRc(K)
48     CALL PRINT_ERROR( msgBuf , 1)
49     WRITE(msgBuf,'(A)')
50     & 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0'
51     CALL PRINT_ERROR( msgBuf , 1)
52     STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID'
53     ENDIF
54     ENDDO
55    
56     C- Calculate depths of centers and interfaces
57     rF(1) = Ro_SeaLevel
58 jmc 1.14 rC(1) = rF(1) + rkSign*delRc(1)
59 jmc 1.13 drC(1) = delRc(1)
60     drF(1) = delRc(1)
61     DO K=2,Nr
62     drC(K) = delRc(K)
63     drF(K-1) = drF(K-1) + 0.5 _d 0*delRc(K)
64     drF(K) = 0.5 _d 0*delRc(K)
65 jmc 1.14 rC(K) = rC(K-1) + rkSign*drC(K)
66     rF(K) = rF(K-1) + rkSign*drF(K-1)
67 jmc 1.13 ENDDO
68     drF(Nr) = drF(Nr) + delRc(Nr+1)
69 jmc 1.14 rF(Nr+1) = rF(Nr) + rkSign*drF(Nr)
70 jmc 1.13
71     ELSE
72     C-- Center at middle between 2 interfaces :
73    
74     C- Check that all thickness are > 0 :
75     DO K=1,Nr
76     IF (delR(K).LE.0.) THEN
77     WRITE(msgBuf,'(A,I4,A,E16.8)')
78     & 'S/R INI_VERTICAL_GRID: delR(K=',K,' )=',delR(K)
79     CALL PRINT_ERROR( msgBuf , 1)
80     WRITE(msgBuf,'(A)')
81     & 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0'
82     CALL PRINT_ERROR( msgBuf , 1)
83     STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID'
84     ENDIF
85     ENDDO
86    
87     C- Calculate depths of interfaces and centers
88 adcroft 1.10 rF(1) = Ro_SeaLevel
89 cnh 1.4 DO K=1,Nr
90 cnh 1.5 drF(K) = delR(K)
91 jmc 1.14 rF(K+1) = rF(K) + rkSign*delR(K)
92 adcroft 1.1 ENDDO
93 cnh 1.5 drC(1) = delR(1) * 0.5 _d 0
94 jmc 1.14 rC(1) = rf(1) + rkSign*delR(1) * 0.5 _d 0
95 cnh 1.4 DO K=2,Nr
96 cnh 1.5 drC(K) = 0.5 _d 0 *(delR(K-1)+delR(K))
97 jmc 1.14 rC(K) = rC(K-1) + rkSign*drC(K)
98 adcroft 1.1 ENDDO
99 jmc 1.13
100     C--
101     ENDIF
102    
103     C- Calculate reciprol vertical grid spacing :
104 cnh 1.4 DO K=1,Nr
105 cnh 1.6 saFac(K) = 1. _d 0
106 cnh 1.4 recip_drC(K) = 1. _d 0/drC(K)
107     recip_drF(K) = 1. _d 0/drF(K)
108 adcroft 1.1 ENDDO
109 jmc 1.13
110 jmc 1.15 _END_MASTER(myThid)
111     _BARRIER
112    
113 adcroft 1.1 RETURN
114     END

  ViewVC Help
Powered by ViewVC 1.1.22