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

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

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


Revision 1.20 - (show annotations) (download)
Thu Nov 13 21:54:11 2003 UTC (20 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint56b_post, checkpoint52j_pre, checkpoint54d_post, checkpoint54e_post, checkpoint57d_post, checkpoint52l_post, checkpoint52k_post, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint53, checkpoint52f_post, checkpoint54f_post, checkpoint55i_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint55c_post, checkpoint52e_pre, checkpoint57f_post, checkpoint52e_post, checkpoint53d_post, checkpoint57a_post, checkpoint52b_pre, checkpoint54b_post, checkpoint52m_post, checkpoint55g_post, checkpoint52b_post, checkpoint52c_post, checkpoint57c_post, checkpoint52f_pre, checkpoint55d_post, checkpoint54a_pre, checkpoint53c_post, checkpoint55d_pre, checkpoint57c_pre, checkpoint55j_post, checkpoint54a_post, checkpoint55h_post, checkpoint57e_post, checkpoint55b_post, checkpoint53a_post, checkpoint55f_post, checkpoint52d_post, checkpoint53g_post, eckpoint57e_pre, checkpoint52i_post, checkpoint52h_pre, checkpoint56a_post, checkpoint53f_post, checkpoint52j_post, checkpoint57f_pre, branch-netcdf, checkpoint52n_post, checkpoint53b_pre, checkpoint56c_post, checkpoint57a_pre, checkpoint55a_post, checkpoint53b_post, checkpoint52a_post, checkpoint53d_pre, checkpoint55e_post, checkpoint54c_post
Branch point for: netcdf-sm0
Changes since 1.19: +2 -2 lines
additional changes for FREEZE:
 - new S/R FREEZE_SURFACE only apllied to surface level.
 - add run-time parameter "useOldFreezing" to use the old version "FREEZE"

1 C $Header: /u/gcmpack/MITgcm/model/src/ini_theta.F,v 1.19 2003/11/13 06:35:14 dimitri Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: INI_THETA
8 C !INTERFACE:
9 SUBROUTINE INI_THETA( myThid )
10 C !DESCRIPTION: \bv
11 C *==========================================================*
12 C | SUBROUTINE INI_THETA
13 C | o Set model initial temperature field.
14 C *==========================================================*
15 C | There are several options for setting the initial
16 C | temperature file
17 C | 1. Inline code
18 C | 2. Vertical profile ( uniform T in X and Y )
19 C | 3. Three-dimensional data from a file. For example from
20 C | Levitus or from a checkpoint file from a previous
21 C | integration.
22 C | In addition to setting the temperature field we also
23 C | set the initial temperature tendency term here.
24 C *==========================================================*
25 C \ev
26
27 C !USES:
28 IMPLICIT NONE
29 C === Global variables ===
30 #include "SIZE.h"
31 #include "EEPARAMS.h"
32 #include "PARAMS.h"
33 #include "GRID.h"
34 #include "DYNVARS.h"
35
36 C !INPUT/OUTPUT PARAMETERS:
37 C == Routine arguments ==
38 C myThid - Number of this instance of INI_THETA
39 INTEGER myThid
40
41 C !LOCAL VARIABLES:
42 C == Local variables ==
43 C iC, jC - Center of domain
44 C iD, jD - Disitance from domain center.
45 C rad - Radius of initial patch
46 C rD - Radial displacement of point I,J
47 C iG, jG - Global coordinate index
48 C bi,bj - Loop counters
49 C I,J,K
50 INTEGER iC, jC, iD, jD
51 INTEGER iG, jG
52 INTEGER bi, bj
53 INTEGER I, J, K, localWarnings
54 _RL rad, rD, Tfreezing
55 CHARACTER*(MAX_LEN_MBUF) msgBuf
56 CEOP
57
58 C-- Initialise temperature field to the vertical reference profile
59 DO bj = myByLo(myThid), myByHi(myThid)
60 DO bi = myBxLo(myThid), myBxHi(myThid)
61 DO K=1,Nr
62 DO J=1-Oly,sNy+Oly
63 DO I=1-Olx,sNx+Olx
64 theta(I,J,K,bi,bj) = tRef(K)
65 ENDDO
66 ENDDO
67 ENDDO
68 ENDDO
69 ENDDO
70
71 IF ( hydrogThetaFile .NE. ' ' ) THEN
72 _BEGIN_MASTER( myThid )
73 CALL READ_FLD_XYZ_RL( hydrogThetaFile, ' ', theta, 0, myThid )
74 _END_MASTER(myThid)
75 _EXCH_XYZ_R8(theta,myThid)
76 ENDIF
77
78 C-- Apply mask and test consistency
79 localWarnings=0
80 DO bj = myByLo(myThid), myByHi(myThid)
81 DO bi = myBxLo(myThid), myBxHi(myThid)
82 DO K=1,Nr
83 DO J=1,sNy
84 DO I=1,sNx
85 IF (hFacC(I,J,K,bi,bj).EQ.0) theta(I,J,K,bi,bj) = 0.
86 IF (hFacC(I,J,K,bi,bj).NE.0.AND.theta(I,J,K,bi,bj).EQ.0.
87 & .AND. tRef(k).NE.0.) THEN
88 localWarnings=localWarnings+1
89 ENDIF
90 ENDDO
91 ENDDO
92 ENDDO
93 ENDDO
94 ENDDO
95 IF (localWarnings.NE.0) THEN
96 WRITE(msgBuf,'(A,A)')
97 & 'S/R INI_THETA: theta = 0 identically. If this is intentional',
98 & 'you will need to edit ini_theta.F to avoid this safety check'
99 CALL PRINT_ERROR( msgBuf , myThid)
100 STOP 'ABNORMAL END: S/R INI_THETA'
101 ENDIF
102
103 C-- Check that there are no values of temperature below freezing point.
104 Tfreezing=-1.9 _d 0
105 IF ( allowFreezing ) THEN
106 DO bj = myByLo(myThid), myByHi(myThid)
107 DO bi = myBxLo(myThid), myBxHi(myThid)
108 DO K=1,Nr
109 DO J=1-Oly,sNy+Oly
110 DO I=1-Olx,sNx+Olx
111 IF (theta(I,J,k,bi,bj) .LT. Tfreezing) THEN
112 theta(I,J,K,bi,bj) = Tfreezing
113 ENDIF
114 ENDDO
115 ENDDO
116 ENDDO
117 ENDDO
118 ENDDO
119 ENDIF
120
121 CALL PLOT_FIELD_XYZRL( theta, 'Initial Temperature' ,
122 & Nr, 1, myThid )
123
124 RETURN
125 END

  ViewVC Help
Powered by ViewVC 1.1.22