/[MITgcm]/MITgcm/verification/hs94.cs-32x32x5/code/ini_theta.F
ViewVC logotype

Annotation of /MITgcm/verification/hs94.cs-32x32x5/code/ini_theta.F

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


Revision 1.8 - (hide annotations) (download)
Sun Sep 27 23:49:28 2009 UTC (14 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint65o, checkpoint62b, checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint61z, checkpoint61w, checkpoint61x, checkpoint61y, HEAD
Changes since 1.7: +21 -22 lines
updated after changing ZONAL_FILTER S/R interface

1 jmc 1.8 C $Header: /u/gcmpack/MITgcm/verification/hs94.cs-32x32x5/code/ini_theta.F,v 1.7 2009/04/28 18:06:14 jmc Exp $
2 adcroft 1.3 C $Name: $
3 adcroft 1.2
4 jmc 1.6 #include "PACKAGES_CONFIG.h"
5 adcroft 1.2 #include "CPP_OPTIONS.h"
6    
7 jmc 1.6 CBOP
8     C !ROUTINE: INI_THETA
9     C !INTERFACE:
10 adcroft 1.2 SUBROUTINE INI_THETA( myThid )
11 jmc 1.6 C !DESCRIPTION: \bv
12     C *==========================================================*
13 jmc 1.8 C | SUBROUTINE INI_THETA
14     C | o Set model initial temperature field.
15 jmc 1.6 C *==========================================================*
16 jmc 1.8 C | There are several options for setting the initial
17     C | temperature file
18     C | 1. Inline code
19     C | 2. Vertical profile ( uniform T in X and Y )
20     C | 3. Three-dimensional data from a file. For example from
21     C | Levitus or from a checkpoint file from a previous
22     C | integration.
23     C | In addition to setting the temperature field we also
24     C | set the initial temperature tendency term here.
25 jmc 1.6 C *==========================================================*
26     C \ev
27    
28     C !USES:
29 adcroft 1.2 IMPLICIT NONE
30    
31     C === Global variables ===
32     #include "SIZE.h"
33     #include "EEPARAMS.h"
34     #include "PARAMS.h"
35     #include "GRID.h"
36     #include "DYNVARS.h"
37    
38 jmc 1.6 C !INPUT/OUTPUT PARAMETERS:
39 adcroft 1.2 C == Routine arguments ==
40     C myThid - Number of this instance of INI_THETA
41     INTEGER myThid
42    
43     C == Functions ==
44 jmc 1.8 c real*8 PORT_RAND
45     c real*8 seed
46 adcroft 1.2
47 jmc 1.6 C !LOCAL VARIABLES:
48 adcroft 1.2 C == Local variables ==
49     C bi,bj - Loop counters
50     C I,J,K
51     INTEGER bi, bj
52 jmc 1.6 INTEGER I, J, K, localWarnings
53 adcroft 1.2 _RL term1,term2,thetaLim,thetaEq
54 jmc 1.6 CHARACTER*(MAX_LEN_MBUF) msgBuf
55     CEOP
56 adcroft 1.2
57     J = 99+myBxLo(myThid)+nPx*myByLo(myThid)
58     c CALL SRAND( J )
59 molod 1.5 c seed = j
60 adcroft 1.2
61     IF ( hydrogThetaFile .EQ. ' ' ) THEN
62 jmc 1.6 C-- Initialise temperature field to Held & Saurez equilibrium theta
63 adcroft 1.2 DO bj = myByLo(myThid), myByHi(myThid)
64     DO bi = myBxLo(myThid), myBxHi(myThid)
65     DO K=1,Nr
66 jmc 1.4 thetaLim = 200. _d 0/((rC(K)/atm_po)**atm_kappa)
67 adcroft 1.2 DO J=1,sNy
68     DO I=1,sNx
69 jmc 1.6 term1=60. _d 0*(sin(yC(I,J,bi,bj)*deg2rad)**2)
70     term2=10. _d 0*log((rC(K)/atm_po))
71 adcroft 1.2 & *(cos(yC(I,J,bi,bj)*deg2rad)**2)
72 jmc 1.6 thetaEq=315. _d 0-term1-term2
73 adcroft 1.2 theta(I,J,K,bi,bj) = MAX( thetaLim, thetaEq )
74     c & + 0.01*(RAND()-0.5)
75 molod 1.5 c & + 0.01*(PORT_RAND(seed)-0.5)
76 adcroft 1.2 c theta(I,J,K,bi,bj) = tRef(K)
77     ENDDO
78     ENDDO
79     ENDDO
80 jmc 1.4 #ifdef ALLOW_ZONAL_FILT
81     C-- Zonal FFT filter initial conditions
82 jmc 1.6 IF (useZONAL_FILT) THEN
83     CALL ZONAL_FILTER(
84 jmc 1.8 U theta(1-OLx,1-OLy,1,bi,bj),
85     I hFacC(1-OLx,1-OLy,1,bi,bj),
86     I 1, sNy, Nr, bi, bj, 1, myThid )
87 jmc 1.6 ENDIF
88     #endif /* ALLOW_ZONAL_FILT */
89 adcroft 1.2 ENDDO
90     ENDDO
91     ELSE
92     CALL READ_FLD_XYZ_RL( hydrogThetaFile, ' ', theta, 0, myThid )
93     ENDIF
94 jmc 1.6 C-- Apply mask and test consistency
95     localWarnings=0
96 adcroft 1.2 DO bj = myByLo(myThid), myByHi(myThid)
97     DO bi = myBxLo(myThid), myBxHi(myThid)
98     DO K=1,Nr
99 jmc 1.6 DO J=1-Oly,sNy+Oly
100     DO I=1-Olx,sNx+Olx
101     IF (maskC(I,J,K,bi,bj).EQ.0.) theta(I,J,K,bi,bj) = 0.
102 adcroft 1.2 ENDDO
103     ENDDO
104 jmc 1.6 IF ( tRef(k).NE.0. ) THEN
105     DO J=1,sNy
106     DO I=1,sNx
107     IF ( maskC(I,J,K,bi,bj).NE.0.
108     & .AND. theta(I,J,K,bi,bj).EQ.0. ) THEN
109     localWarnings=localWarnings+1
110     ENDIF
111     ENDDO
112     ENDDO
113     ENDIF
114 adcroft 1.2 ENDDO
115     ENDDO
116     ENDDO
117 jmc 1.6 IF (localWarnings.NE.0) THEN
118     WRITE(msgBuf,'(A,A)')
119     & 'S/R INI_THETA: theta = 0 identically. If this is intentional',
120     & 'you will need to edit ini_theta.F to avoid this safety check'
121     CALL PRINT_ERROR( msgBuf , myThid)
122     STOP 'ABNORMAL END: S/R INI_THETA'
123     ENDIF
124 adcroft 1.2
125 jmc 1.7 _EXCH_XYZ_RL(theta , myThid )
126 adcroft 1.2
127 jmc 1.8 IF (debugMode) THEN
128     CALL PLOT_FIELD_XYZRL( theta, 'Initial Temperature' ,
129     & Nr, 1, myThid )
130     ENDIF
131 adcroft 1.2
132     RETURN
133     END

  ViewVC Help
Powered by ViewVC 1.1.22