/[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.14 - (show annotations) (download)
Wed Jun 22 00:25:32 2005 UTC (18 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint57m_post, checkpoint57s_post, checkpoint58b_post, checkpoint57y_post, checkpoint57r_post, checkpoint58, checkpoint58f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58m_post, checkpoint57l_post, checkpoint57t_post, checkpoint57v_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58e_post, checkpoint58n_post, checkpoint57p_post, checkpint57u_post, checkpoint57q_post, checkpoint58k_post, checkpoint58l_post, checkpoint57j_post, checkpoint58g_post, checkpoint58h_post, checkpoint58j_post, checkpoint57o_post, checkpoint57k_post, checkpoint57w_post, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post
Changes since 1.13: +8 -8 lines
"rkSign" replaces "-rkFac" (<- removed)

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_vertical_grid.F,v 1.13 2002/03/07 14:09:02 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 IF (setCenterDr) THEN
39 C-- Interface at middle between 2 centers :
40
41 C- Check that all thickness are > 0 :
42 DO K=1,Nr+1
43 IF (delRc(K).LE.0.) THEN
44 WRITE(msgBuf,'(A,I4,A,E16.8)')
45 & 'S/R INI_VERTICAL_GRID: delRc(K=',K,' )=',delRc(K)
46 CALL PRINT_ERROR( msgBuf , 1)
47 WRITE(msgBuf,'(A)')
48 & 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0'
49 CALL PRINT_ERROR( msgBuf , 1)
50 STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID'
51 ENDIF
52 ENDDO
53
54 C- Calculate depths of centers and interfaces
55 rF(1) = Ro_SeaLevel
56 rC(1) = rF(1) + rkSign*delRc(1)
57 drC(1) = delRc(1)
58 drF(1) = delRc(1)
59 DO K=2,Nr
60 drC(K) = delRc(K)
61 drF(K-1) = drF(K-1) + 0.5 _d 0*delRc(K)
62 drF(K) = 0.5 _d 0*delRc(K)
63 rC(K) = rC(K-1) + rkSign*drC(K)
64 rF(K) = rF(K-1) + rkSign*drF(K-1)
65 ENDDO
66 drF(Nr) = drF(Nr) + delRc(Nr+1)
67 rF(Nr+1) = rF(Nr) + rkSign*drF(Nr)
68
69 ELSE
70 C-- Center at middle between 2 interfaces :
71
72 C- Check that all thickness are > 0 :
73 DO K=1,Nr
74 IF (delR(K).LE.0.) THEN
75 WRITE(msgBuf,'(A,I4,A,E16.8)')
76 & 'S/R INI_VERTICAL_GRID: delR(K=',K,' )=',delR(K)
77 CALL PRINT_ERROR( msgBuf , 1)
78 WRITE(msgBuf,'(A)')
79 & 'S/R INI_VERTICAL_GRID: Vert. grid spacing MUST BE > 0'
80 CALL PRINT_ERROR( msgBuf , 1)
81 STOP 'ABNORMAL END: S/R INI_VERTICAL_GRID'
82 ENDIF
83 ENDDO
84
85 C- Calculate depths of interfaces and centers
86 rF(1) = Ro_SeaLevel
87 DO K=1,Nr
88 drF(K) = delR(K)
89 rF(K+1) = rF(K) + rkSign*delR(K)
90 ENDDO
91 drC(1) = delR(1) * 0.5 _d 0
92 rC(1) = rf(1) + rkSign*delR(1) * 0.5 _d 0
93 DO K=2,Nr
94 drC(K) = 0.5 _d 0 *(delR(K-1)+delR(K))
95 rC(K) = rC(K-1) + rkSign*drC(K)
96 ENDDO
97
98 C--
99 ENDIF
100
101 C- Calculate reciprol vertical grid spacing :
102 DO K=1,Nr
103 saFac(K) = 1. _d 0
104 recip_drC(K) = 1. _d 0/drC(K)
105 recip_drF(K) = 1. _d 0/drF(K)
106 ENDDO
107
108 RETURN
109 END

  ViewVC Help
Powered by ViewVC 1.1.22