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

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

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


Revision 1.11 - (hide annotations) (download)
Wed Dec 9 16:11:52 1998 UTC (25 years, 6 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint19, checkpoint20, checkpoint21, checkpoint22, checkpoint23
Changes since 1.10: +2 -1 lines
Added IMPLICIT NONE in a lot of subroutines.
Also corrected the recip_Rhonil bug: we didn't set it in ini_parms.F

1 adcroft 1.11 C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_theta.F,v 1.10 1998/12/08 18:04:51 adcroft Exp $
2 cnh 1.1
3 cnh 1.9 #include "CPP_OPTIONS.h"
4 cnh 1.1
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 adcroft 1.11 IMPLICIT NONE
22 cnh 1.1
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 iC, jC - Center of domain
37     C iD, jD - Disitance from domain center.
38     C rad - Radius of initial patch
39     C rD - Radial displacement of point I,J
40     C iG, jG - Global coordinate index
41     C bi,bj - Loop counters
42     C I,J,K
43     INTEGER iC, jC, iD, jD
44     INTEGER iG, jG
45     INTEGER bi, bj
46     INTEGER I, J, K
47     REAL rad, rD
48    
49 cnh 1.3 _BARRIER
50    
51     IF ( hydrogThetaFile .EQ. ' ' ) THEN
52     C-- Example 1
53     C-- Initialise temperature field to a circular patch.
54     iC = Nx/2
55     jC = Ny/2
56     rad = MIN(Ny/8,Nx/8)
57     DO bj = myByLo(myThid), myByHi(myThid)
58     DO bi = myBxLo(myThid), myBxHi(myThid)
59 cnh 1.7 DO K=1,Nr
60 cnh 1.3 DO J=1,sNy
61     DO I=1,sNx
62     theta(I,J,K,bi,bj) = 0. _d 0
63     iG = myXGlobalLo-1+(bi-1)*sNx+I
64     jG = myYGlobalLo-1+(bj-1)*sNy+J
65     iD = iG-iC
66     jD = jG-jC
67     rD = SQRT(FLOAT(iD*iD+jD*jD))
68     IF ( rD .LT. rad ) theta(I,J,K,bi,bj) = 1. _d 0
69     ENDDO
70 cnh 1.1 ENDDO
71     ENDDO
72     ENDDO
73     ENDDO
74 cnh 1.3 C-- Example 2
75     C-- Initialise temperature field to the vertical reference profile
76     DO bj = myByLo(myThid), myByHi(myThid)
77     DO bi = myBxLo(myThid), myBxHi(myThid)
78 cnh 1.7 DO K=1,Nr
79 cnh 1.3 DO J=1,sNy
80     DO I=1,sNx
81     theta(I,J,K,bi,bj) = tRef(K)
82     ENDDO
83 cnh 1.1 ENDDO
84     ENDDO
85     ENDDO
86     ENDDO
87 cnh 1.3 ELSE
88     _BEGIN_MASTER( myThid )
89 cnh 1.4 CALL READ_FLD_XYZ_RL( hydrogThetaFile, ' ', theta, 0, myThid )
90 cnh 1.3 _END_MASTER(myThid)
91     ENDIF
92 cnh 1.1 C Set initial tendency terms
93     DO bj = myByLo(myThid), myByHi(myThid)
94     DO bi = myBxLo(myThid), myBxHi(myThid)
95 cnh 1.7 DO K=1,Nr
96 cnh 1.1 DO J=1,sNy
97     DO I=1,sNx
98     gt (I,J,K,bi,bj) = 0. _d 0
99     gtNM1(I,J,K,bi,bj) = 0. _d 0
100 adcroft 1.10 IF (hFacC(I,J,K,bi,bj).EQ.0) theta(I,J,K,bi,bj) = 0.
101 cnh 1.1 ENDDO
102     ENDDO
103     ENDDO
104     ENDDO
105     ENDDO
106     C
107     _EXCH_XYZ_R8(theta , myThid )
108     _EXCH_XYZ_R8(gt , myThid )
109     _EXCH_XYZ_R8(gtNM1 , myThid )
110 cnh 1.5
111 cnh 1.8 CALL PLOT_FIELD_XYZRL( theta, 'Initial Temperature' ,
112     & Nr, 1, myThid )
113 cnh 1.5
114 cnh 1.1 RETURN
115     END

  ViewVC Help
Powered by ViewVC 1.1.22