/[MITgcm]/MITgcm/verification/hs94.1x64x5/code/ini_theta.F
ViewVC logotype

Diff of /MITgcm/verification/hs94.1x64x5/code/ini_theta.F

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

revision 1.1 by adcroft, Tue Jan 23 16:23:06 2001 UTC revision 1.2 by adcroft, Fri Feb 2 21:36:34 2001 UTC
# Line 0  Line 1 
1    C $Header$
2    
3    #include "CPP_OPTIONS.h"
4    
5    CStartOfInterface
6          SUBROUTINE INI_THETA( myThid )
7    C     /==========================================================\
8    C     | SUBROUTINE INI_THETA                                     |
9    C     | o Set model initial temperature field.                   |
10    C     |==========================================================|
11    C     | There are several options for setting the initial        |
12    C     | temperature file                                         |
13    C     |  1. Inline code                                          |
14    C     |  2. Vertical profile ( uniform T in X and Y )            |
15    C     |  3. Three-dimensional data from a file. For example from |
16    C     |     Levitus or from a checkpoint file from a previous    |
17    C     |     integration.                                         |
18    C     | In addition to setting the temperature field we also     |
19    C     | set the initial temperature tendency term here.          |
20    C     \==========================================================/
21          IMPLICIT NONE
22    
23    C     === Global variables ===
24    #include "SIZE.h"
25    #include "EEPARAMS.h"
26    #include "PARAMS.h"
27    #include "GRID.h"
28    #include "DYNVARS.h"
29    
30    C     == Routine arguments ==
31    C     myThid -  Number of this instance of INI_THETA
32          INTEGER myThid
33    CEndOfInterface
34    
35    C     == Local variables ==
36    C     bi,bj  - Loop counters
37    C     I,J,K
38          INTEGER bi, bj
39          INTEGER I, J, K, localWarnings
40          _RL     term1,term2,thetaLim,thetaEq
41          _RL     thKappa,rSurf
42          CHARACTER*(MAX_LEN_MBUF) msgBuf
43    
44          _BARRIER
45    
46          IF ( hydrogThetaFile .EQ. ' ' ) THEN
47    C--    Initialise temperature field to Held & Saurez equilibrium theta
48           DO bj = myByLo(myThid), myByHi(myThid)
49            DO bi = myBxLo(myThid), myBxHi(myThid)
50             DO K=1,Nr
51              rSurf=1.E5
52              thKappa = 2./7.
53              thetaLim = 200. / ((rC(K)/rSurf)**thKappa)
54    C         thetaLim = 170. / ((rC(K)/rSurf)**thKappa)
55              DO J=1,sNy
56               term1=60.*(sin(yC(1,J,bi,bj)*deg2rad)**2)
57               term2=10.*log((rC(K)/rSurf))
58         &              *(cos(yC(1,J,bi,bj)*deg2rad)**2)
59               thetaEq=315.-term1-term2
60               DO I=1,sNx
61                theta(I,J,K,bi,bj) = MAX( thetaLim, thetaEq )
62    C           theta(I,J,K,bi,bj) = tRef(K)
63               ENDDO
64              ENDDO
65             ENDDO
66            ENDDO
67           ENDDO
68          ELSE
69           _BEGIN_MASTER( myThid )
70           CALL READ_FLD_XYZ_RL( hydrogThetaFile, ' ', theta, 0, myThid )
71           _END_MASTER(myThid)
72          ENDIF
73    C     Set initial tendency terms
74          localWarnings=0
75          DO bj = myByLo(myThid), myByHi(myThid)
76           DO bi = myBxLo(myThid), myBxHi(myThid)
77            DO K=1,Nr
78             DO J=1,sNy
79              DO I=1,sNx
80               gt   (I,J,K,bi,bj) = 0. _d 0
81               gtNM1(I,J,K,bi,bj) = 0. _d 0
82               IF (hFacC(I,J,K,bi,bj).EQ.0) theta(I,J,K,bi,bj) = 0.
83               IF (hFacC(I,J,K,bi,bj).NE.0.AND.theta(I,J,K,bi,bj).EQ.0.)
84         &      THEN
85                 localWarnings=localWarnings+1
86                ENDIF
87              ENDDO
88             ENDDO
89            ENDDO
90           ENDDO
91          ENDDO
92          IF (localWarnings.NE.0) THEN
93           WRITE(msgBuf,'(A,A)')
94         &  'S/R INI_THETA: theta = 0 identically. If this is intentional',
95         &  'you will need to edit ini_theta.F to avoid this safety check'
96           CALL PRINT_ERROR( msgBuf , myThid)
97           STOP 'ABNORMAL END: S/R INI_THETA'
98          ENDIF
99    C
100          _EXCH_XYZ_R8(theta , myThid )
101          _EXCH_XYZ_R8(gt , myThid )
102          _EXCH_XYZ_R8(gtNM1 , myThid )
103    
104          CALL PLOT_FIELD_XYZRL( theta, 'Initial Temperature' ,
105         &                       Nr, 1, myThid )
106    
107          RETURN
108          END

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

  ViewVC Help
Powered by ViewVC 1.1.22