1 |
molod |
1.1 |
C $Header: /u/gcmpack/MITgcm/pkg/fizhi/fizhi_init_vars-fake.F,v 1.4 2004/05/05 00:39:21 edhill Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
subroutine fizhi_init_vars (myThid) |
5 |
|
|
c----------------------------------------------------------------------- |
6 |
|
|
c Routine to initialise the fizhi state. |
7 |
|
|
c |
8 |
|
|
c Input: myThid - Process number calling this routine |
9 |
|
|
c |
10 |
|
|
c Notes: |
11 |
|
|
c 1) For a Cold Start - |
12 |
|
|
c This routine takes the initial condition on the dynamics grid |
13 |
|
|
c and interpolates to the physics grid to initialize the state |
14 |
|
|
c variables that are on both grids. It initializes the variables |
15 |
|
|
c of the turbulence scheme to 0., and the land state from a model |
16 |
|
|
c climatology. |
17 |
|
|
c 2) For a Restart, read the fizhi pickup file |
18 |
|
|
c 3) The velocity component physics fields are on an A-Grid |
19 |
|
|
c |
20 |
|
|
c Calls: dyn2phys (x4) |
21 |
|
|
c----------------------------------------------------------------------- |
22 |
|
|
implicit none |
23 |
|
|
#include "CPP_OPTIONS.h" |
24 |
|
|
#include "SIZE.h" |
25 |
|
|
#include "fizhi_SIZE.h" |
26 |
|
|
#include "land_SIZE.h" |
27 |
|
|
#include "GRID.h" |
28 |
|
|
#include "DYNVARS.h" |
29 |
|
|
#include "gridalt_mapping.h" |
30 |
|
|
#include "fizhi_coms.h" |
31 |
|
|
#include "land_coms.h" |
32 |
|
|
#include "EEPARAMS.h" |
33 |
|
|
#include "SURFACE.h" |
34 |
|
|
#include "PARAMS.h" |
35 |
|
|
|
36 |
|
|
integer myThid |
37 |
|
|
|
38 |
|
|
c pe on dynamics and physics grid refers to bottom edge |
39 |
|
|
_RL pephy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys+1,nSx,nSy) |
40 |
|
|
_RL pedyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy) |
41 |
|
|
_RL windphy(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) |
42 |
|
|
_RL udyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
43 |
|
|
_RL vdyntemp(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy) |
44 |
|
|
|
45 |
|
|
integer i, j, L, bi, bj, Lbotij |
46 |
|
|
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
47 |
|
|
|
48 |
|
|
im1 = 1-OLx |
49 |
|
|
im2 = sNx+OLx |
50 |
|
|
jm1 = 1-OLy |
51 |
|
|
jm2 = sNy+OLy |
52 |
|
|
idim1 = 1 |
53 |
|
|
idim2 = sNx |
54 |
|
|
jdim1 = 1 |
55 |
|
|
jdim2 = sNy |
56 |
|
|
|
57 |
|
|
IF ( startTime.EQ.0. .AND. nIter0.EQ.0 ) THEN |
58 |
|
|
print *,' In fizhi_init_vars: Cold start ' |
59 |
|
|
|
60 |
|
|
do bj = myByLo(myThid), myByHi(myThid) |
61 |
|
|
do bi = myBxLo(myThid), myBxHi(myThid) |
62 |
|
|
|
63 |
|
|
C Build pressures on dynamics grid |
64 |
|
|
do j = 1,sNy |
65 |
|
|
do i = 1,sNx |
66 |
|
|
do L = 1,Nr |
67 |
|
|
pedyn(i,j,L,bi,bj) = 0. |
68 |
|
|
enddo |
69 |
|
|
enddo |
70 |
|
|
enddo |
71 |
|
|
do j = 1,sNy |
72 |
|
|
do i = 1,sNx |
73 |
|
|
Lbotij = ksurfC(i,j,bi,bj) |
74 |
|
|
if(Lbotij.ne.0.) |
75 |
|
|
. pedyn(i,j,Lbotij,bi,bj) = Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) |
76 |
|
|
enddo |
77 |
|
|
enddo |
78 |
|
|
do j = 1,sNy |
79 |
|
|
do i = 1,sNx |
80 |
|
|
Lbotij = ksurfC(i,j,bi,bj) |
81 |
|
|
do L = Lbotij+1,Nr+1 |
82 |
|
|
pedyn(i,j,L,bi,bj) = pedyn(i,j,L-1,bi,bj) - |
83 |
|
|
. drF(L-1)*hfacC(i,j,L-1,bi,bj) |
84 |
|
|
enddo |
85 |
|
|
c Do not use a zero field as the top edge pressure for interpolation |
86 |
|
|
if(pedyn(i,j,Nr+1,bi,bj).lt.1.e-5) |
87 |
|
|
. pedyn(i,j,Nr+1,bi,bj) = 1.e-5 |
88 |
|
|
enddo |
89 |
|
|
enddo |
90 |
|
|
C Build pressures on physics grid |
91 |
|
|
do j = 1,sNy |
92 |
|
|
do i = 1,sNx |
93 |
|
|
pephy(i,j,1,bi,bj)=Ro_surf(i,j,bi,bj) + etaH(i,j,bi,bj) |
94 |
|
|
do L = 2,Nrphys+1 |
95 |
|
|
pephy(i,j,L,bi,bj)=pephy(i,j,L-1,bi,bj)-dpphys0(i,j,L-1,bi,bj) |
96 |
|
|
enddo |
97 |
|
|
c Do not use a zero field as the top edge pressure for interpolation |
98 |
|
|
if(pephy(i,j,Nrphys+1,bi,bj).lt.1.e-5) |
99 |
|
|
. pephy(i,j,Nrphys+1,bi,bj) = 1.e-5 |
100 |
|
|
enddo |
101 |
|
|
enddo |
102 |
|
|
c |
103 |
|
|
c Create an initial wind magnitude field on the physics grid - |
104 |
|
|
c Use a log wind law with z0=1cm, u*=1 cm/sec, |
105 |
|
|
c do units and get u = .025*ln(dP*10), with dP in pa. |
106 |
|
|
do L = 1,Nrphys |
107 |
|
|
do j = 1,sNy |
108 |
|
|
do i = 1,sNx |
109 |
|
|
windphy(i,j,L,bi,bj) = 0.025 * |
110 |
|
|
. log((pephy(i,j,1,bi,bj)-pephy(i,j,L+1,bi,bj))*10.) |
111 |
|
|
enddo |
112 |
|
|
enddo |
113 |
|
|
enddo |
114 |
|
|
|
115 |
|
|
enddo |
116 |
|
|
enddo |
117 |
|
|
|
118 |
|
|
c Create initial fields on phys. grid - Move Dynamics u and v to A-Grid |
119 |
|
|
call CtoA(myThid,uvel,vvel,maskW,maskS,im1,im2,jm1,jm2,Nr, |
120 |
|
|
. Nsx,Nsy,1,sNx,1,sNy,udyntemp,vdyntemp) |
121 |
|
|
|
122 |
|
|
do bj = myByLo(myThid), myByHi(myThid) |
123 |
|
|
do bi = myBxLo(myThid), myBxHi(myThid) |
124 |
|
|
|
125 |
|
|
c Create initial fields on phys. grid - interpolate from dyn. grid |
126 |
|
|
call dyn2phys(udyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
127 |
|
|
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,uphy) |
128 |
|
|
call dyn2phys(vdyntemp,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
129 |
|
|
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,1,vphy) |
130 |
|
|
call dyn2phys(theta,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
131 |
|
|
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,thphy) |
132 |
|
|
call dyn2phys(salt,pedyn,im1,im2,jm1,jm2,Nr,Nsx,Nsy, |
133 |
|
|
. 1,sNx,1,sNy,bi,bj,windphy,pephy,ksurfC,Nrphys,nlperdyn,0,sphy) |
134 |
|
|
|
135 |
|
|
c Now initialize tke, xlmt, khmt, xxmt, yymt, ctmt, zetamt, |
136 |
|
|
c Now initialize land state too - tcanopy, etc... |
137 |
|
|
do L = 1,Nrphys |
138 |
|
|
do i = 1,nchp |
139 |
|
|
tke(i,L,bi,bj) = 0. |
140 |
|
|
xlmt(i,L,bi,bj) = 0. |
141 |
|
|
khmt(i,L,bi,bj) = 0. |
142 |
|
|
enddo |
143 |
|
|
enddo |
144 |
|
|
c Now initialize land state too - tcanopy, etc... ZERO FOR NOW, |
145 |
|
|
c READ CLIM FOR REAL |
146 |
|
|
do i = 1,nchp |
147 |
|
|
tcanopy(i) = 0. |
148 |
|
|
tdeep(i) = 0. |
149 |
|
|
ecanopy(i) = 0. |
150 |
|
|
swetshal(i) = 0. |
151 |
|
|
swetroot(i) = 0. |
152 |
|
|
swetdeep(i) = 0. |
153 |
|
|
capac(i) = 0. |
154 |
|
|
snodep(i) = 0. |
155 |
|
|
enddo |
156 |
|
|
|
157 |
|
|
enddo |
158 |
|
|
enddo |
159 |
|
|
|
160 |
|
|
ELSE |
161 |
|
|
print *,' In fizhi_init_vars: Read from restart ' |
162 |
|
|
|
163 |
|
|
C-- Read fizhi package state variables from pickup file |
164 |
|
|
call fizhi_read_pickup( nIter0, myThid ) |
165 |
|
|
|
166 |
|
|
ENDIF |
167 |
|
|
|
168 |
|
|
return |
169 |
|
|
end |