1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "FIZHI_OPTIONS.h" |
5 |
subroutine update_ocean_exports (myTime, myIter, myThid) |
subroutine update_ocean_exports (myTime, myIter, myThid) |
6 |
c---------------------------------------------------------------------- |
c---------------------------------------------------------------------- |
7 |
c Subroutine update_ocean_exports - 'Wrapper' routine to update |
c Subroutine update_ocean_exports - 'Wrapper' routine to update |
8 |
c the fields related to the ocean's surface that are needed |
c the fields related to the ocean's surface that are needed |
9 |
c by fizhi. |
c by fizhi (sst and sea ice extent). |
|
c Also: Set up "bi, bj loop" and some timers and clocks here. |
|
10 |
c |
c |
11 |
c Call: getsst (Return the current sst field-read dataset if needed) |
c Call: getsst (Return the current sst field-read dataset if needed) |
12 |
c getsice (Return the current sea ice field-read data if needed) |
c getsice (Return the current sea ice field-read data if needed) |
13 |
c----------------------------------------------------------------------- |
c----------------------------------------------------------------------- |
14 |
implicit none |
implicit none |
|
#include "CPP_OPTIONS.h" |
|
15 |
#include "SIZE.h" |
#include "SIZE.h" |
16 |
#include "GRID.h" |
#include "GRID.h" |
17 |
#include "ocean_coms.h" |
#include "fizhi_ocean_coms.h" |
18 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
19 |
|
#include "chronos.h" |
20 |
|
|
21 |
integer myTime, myIter, myThid |
integer myTime, myIter, myThid |
22 |
|
|
23 |
integer i, j, L, bi, bj |
integer i, j, bi, bj, biglobal, bjglobal |
24 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
integer im1, im2, jm1, jm2, idim1, idim2, jdim1, jdim2 |
25 |
|
integer nSxglobal, nSyglobal |
26 |
im1 = 1-OLx |
integer ksst,kice |
27 |
im2 = sNx+OLx |
_RL sstmin |
28 |
jm1 = 1-OLy |
parameter ( sstmin = 273.16 ) |
29 |
jm2 = sNy+OLy |
|
30 |
idim1 = 1 |
idim1 = 1-OLx |
31 |
idim2 = sNx |
idim2 = sNx+OLx |
32 |
jdim1 = 1 |
jdim1 = 1-OLy |
33 |
jdim2 = sNy |
jdim2 = sNy+OLy |
34 |
|
im1 = 1 |
35 |
do bj = myByLo(myThid), myByHi(myThid) |
im2 = sNx |
36 |
do bi = myBxLo(myThid), myBxHi(myThid) |
jm1 = 1 |
37 |
|
jm2 = sNy |
38 |
c call getsst |
nSxglobal = nSx*nPx |
39 |
c call getsice |
nSyglobal = nSy*nPy |
40 |
|
|
41 |
|
call mdsfindunit( ksst, myThid ) |
42 |
|
call mdsfindunit( kice, myThid ) |
43 |
|
|
44 |
|
C*********************************************************************** |
45 |
|
|
46 |
|
DO BJ = myByLo(myThid),myByHi(myThid) |
47 |
|
DO BI = myBxLo(myThid),myBxHi(myThid) |
48 |
|
|
49 |
|
biglobal=bi+(myXGlobalLo-1)/im2 |
50 |
|
bjglobal=bj+(myYGlobalLo-1)/jm2 |
51 |
|
|
52 |
|
call getsst(ksst,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx, |
53 |
|
. nSy,nSxglobal,nSyglobal,bi,bj,biglobal,bjglobal,nymd,nhms,sst) |
54 |
|
call getsice(kice,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSx, |
55 |
|
. nSy,nSxglobal,nSyglobal,bi,bj,biglobal,bjglobal,nymd,nhms,sice) |
56 |
|
|
57 |
|
c Check for Minimum Open-Water SST |
58 |
|
c -------------------------------- |
59 |
|
do j=jm1,jm2 |
60 |
|
do i=im1,im2 |
61 |
|
if(sice(i,j,bi,bj).eq.0.0 .and. sst(i,j,bi,bj).lt.sstmin) |
62 |
|
. sst(i,j,bi,bj) = sstmin |
63 |
enddo |
enddo |
64 |
enddo |
enddo |
65 |
|
|
66 |
|
ENDDO |
67 |
|
ENDDO |
68 |
|
|
69 |
return |
return |
70 |
end |
end |
71 |
|
|
72 |
|
subroutine getsice(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2, |
73 |
|
. nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sice) |
74 |
|
C************************************************************************ |
75 |
|
C |
76 |
|
C!ROUTINE: GETSICE |
77 |
|
C!DESCRIPTION: GETSICE returns the sea ice depth. |
78 |
|
C! This routine is adaptable for any frequency |
79 |
|
C! data upto a daily frequency. |
80 |
|
C! note: for diurnal data ndmax should be increased. |
81 |
|
C |
82 |
|
C!INPUT PARAMETERS: |
83 |
|
C! iunit Unit number assigned to the sice data file |
84 |
|
C! idim1 Start dimension in x-direction |
85 |
|
C! idim2 End dimension in x-direction |
86 |
|
C! jdim1 Start dimension in y-direction |
87 |
|
C! jdim2 End dimension in y-direction |
88 |
|
C! im1 Begin of x-direction span for filling sice |
89 |
|
C! im2 End of x-direction span for filling sice |
90 |
|
C! jm1 Begin of y-direction span for filling sice |
91 |
|
C! jm2 End of y-direction span for filling sice |
92 |
|
C! nSumx Number of processors in x-direction (local processor) |
93 |
|
C! nSumy Number of processors in y-direction (local processor) |
94 |
|
C! nPgx Number of processors in x-direction (global) |
95 |
|
C! nPgx Number of processors in y-direction (global) |
96 |
|
C! bi Processor number in x-direction (local to processor) |
97 |
|
C! bj Processor number in y-direction (local to processor) |
98 |
|
C! biglobal Processor number in x-direction (global) |
99 |
|
C! bjglobal Processor number in y-direction (global) |
100 |
|
C! nymd YYMMDD of the current model timestep |
101 |
|
C! nhms HHMMSS of the model time |
102 |
|
C |
103 |
|
C!OUTPUT PARAMETERS: |
104 |
|
C! sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea ice depth in meters |
105 |
|
C |
106 |
|
C!ROUTINES CALLED: |
107 |
|
C |
108 |
|
C! bcdata Reads the data for a given unit number |
109 |
|
C! bcheader Reads the header info for a given unit number |
110 |
|
C! interp_time Returns weights for linear interpolation |
111 |
|
C |
112 |
|
C-------------------------------------------------------------------------- |
113 |
|
|
114 |
|
implicit none |
115 |
|
#include "SIZE.h" |
116 |
|
|
117 |
|
integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy |
118 |
|
integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms |
119 |
|
|
120 |
|
_RL sice(idim1:idim2,jdim1:jdim2,nSumx,nSumy) |
121 |
|
|
122 |
|
integer i,j |
123 |
|
|
124 |
|
do j = jm1,jm2 |
125 |
|
do i = im1,im2 |
126 |
|
sice(i,j,bi,bj) = 0. |
127 |
|
enddo |
128 |
|
enddo |
129 |
|
|
130 |
|
return |
131 |
|
end |
132 |
|
subroutine getsst(iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2, |
133 |
|
. nSumx,nSumy,nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms,sst) |
134 |
|
C************************************************************************ |
135 |
|
C |
136 |
|
C!ROUTINE: GETSST |
137 |
|
C!DESCRIPTION: GETSST gets the SST data. |
138 |
|
C! This routine is adaptable for any frequency |
139 |
|
C! data upto a daily frequency. |
140 |
|
C! note: for diurnal data ndmax should be increased. |
141 |
|
C |
142 |
|
C!INPUT PARAMETERS: |
143 |
|
C! iunit Unit number assigned to the sice data file |
144 |
|
C! idim1 Start dimension in x-direction |
145 |
|
C! idim2 End dimension in x-direction |
146 |
|
C! jdim1 Start dimension in y-direction |
147 |
|
C! jdim2 End dimension in y-direction |
148 |
|
C! im1 Begin of x-direction span for filling sice |
149 |
|
C! im2 End of x-direction span for filling sice |
150 |
|
C! jm1 Begin of y-direction span for filling sice |
151 |
|
C! jm2 End of y-direction span for filling sice |
152 |
|
C! nSumx Number of processors in x-direction (local processor) |
153 |
|
C! nSumy Number of processors in y-direction (local processor) |
154 |
|
C! nPgx Number of processors in x-direction (global) |
155 |
|
C! nPgy Number of processors in y-direction (global) |
156 |
|
C! bi Processor number in x-direction (local to processor) |
157 |
|
C! bj Processor number in y-direction (local to processor) |
158 |
|
C! biglobal Processor number in x-direction (global) |
159 |
|
C! bjglobal Processor number in y-direction (global) |
160 |
|
C! nymd YYMMDD of the current model timestep |
161 |
|
C! nhms HHMMSS of the model time |
162 |
|
C |
163 |
|
C!OUTPUT PARAMETERS: |
164 |
|
C! sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy) Sea surface temperature (K) |
165 |
|
C |
166 |
|
C!ROUTINES CALLED: |
167 |
|
C |
168 |
|
C! bcdata Reads the data for a given unit number |
169 |
|
C! bcheader Reads the header info for a given unit number |
170 |
|
C! interp_time Returns weights for linear interpolation |
171 |
|
C |
172 |
|
C-------------------------------------------------------------------------- |
173 |
|
|
174 |
|
implicit none |
175 |
|
#include "SIZE.h" |
176 |
|
|
177 |
|
integer iunit,idim1,idim2,jdim1,jdim2,im1,im2,jm1,jm2,nSumx,nSumy |
178 |
|
integer nPgx,nPgy,bi,bj,biglobal,bjglobal,nymd,nhms |
179 |
|
|
180 |
|
_RL sst(idim1:idim2,jdim1:jdim2,nSumx,nSumy) |
181 |
|
|
182 |
|
integer i,j |
183 |
|
|
184 |
|
do j = jm1,jm2 |
185 |
|
do i = im1,im2 |
186 |
|
sst(i,j,bi,bj) = 280. |
187 |
|
enddo |
188 |
|
enddo |
189 |
|
|
190 |
|
return |
191 |
|
end |