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

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

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


Revision 1.15 - (show annotations) (download)
Tue Oct 17 18:52:34 2006 UTC (17 years, 7 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 C $Header: /u/gcmpack/MITgcm/model/src/ini_vertical_grid.F,v 1.14 2005/06/22 00:25:32 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_VERTICAL_GRID
8 C !INTERFACE:
9 SUBROUTINE INI_VERTICAL_GRID( myThid )
10 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 IMPLICIT NONE
19 C === Global variables ===
20 #include "SIZE.h"
21 #include "EEPARAMS.h"
22 #include "PARAMS.h"
23 #include "GRID.h"
24
25 C !INPUT/OUTPUT PARAMETERS:
26 C == Routine arguments ==
27 C myThid - Number of this instance of INI_DEPTHS
28 INTEGER myThid
29
30 C !LOCAL VARIABLES:
31 C == Local variables ==
32 C K :: loop index
33 C msgBuf :: Informational/error meesage buffer
34 INTEGER K
35 CHARACTER*(MAX_LEN_MBUF) msgBuf
36 CEOP
37
38 _BEGIN_MASTER(myThid)
39
40 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 rC(1) = rF(1) + rkSign*delRc(1)
59 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 rC(K) = rC(K-1) + rkSign*drC(K)
66 rF(K) = rF(K-1) + rkSign*drF(K-1)
67 ENDDO
68 drF(Nr) = drF(Nr) + delRc(Nr+1)
69 rF(Nr+1) = rF(Nr) + rkSign*drF(Nr)
70
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 rF(1) = Ro_SeaLevel
89 DO K=1,Nr
90 drF(K) = delR(K)
91 rF(K+1) = rF(K) + rkSign*delR(K)
92 ENDDO
93 drC(1) = delR(1) * 0.5 _d 0
94 rC(1) = rf(1) + rkSign*delR(1) * 0.5 _d 0
95 DO K=2,Nr
96 drC(K) = 0.5 _d 0 *(delR(K-1)+delR(K))
97 rC(K) = rC(K-1) + rkSign*drC(K)
98 ENDDO
99
100 C--
101 ENDIF
102
103 C- Calculate reciprol vertical grid spacing :
104 DO K=1,Nr
105 saFac(K) = 1. _d 0
106 recip_drC(K) = 1. _d 0/drC(K)
107 recip_drF(K) = 1. _d 0/drF(K)
108 ENDDO
109
110 _END_MASTER(myThid)
111 _BARRIER
112
113 RETURN
114 END

  ViewVC Help
Powered by ViewVC 1.1.22