1 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/Attic/cost_readtmifields.F,v 1.1.2.1 2003/06/19 15:21:16 heimbach Exp $ |
2 |
|
3 |
#include "COST_CPPOPTIONS.h" |
4 |
|
5 |
|
6 |
subroutine cost_ReadTMIFields( |
7 |
I irec, |
8 |
I mythid |
9 |
& ) |
10 |
|
11 |
c ================================================================== |
12 |
c SUBROUTINE cost_ReadTMIFields |
13 |
c ================================================================== |
14 |
c |
15 |
c o Read a given record of the TMI SST data. |
16 |
c |
17 |
c started: ARmin Koehl akoehl@ucsd.edu |
18 |
c - Restructured the code in order to create a package |
19 |
c for the MITgcmUV. |
20 |
c |
21 |
c ================================================================== |
22 |
c SUBROUTINE cost_ReadTMIFields |
23 |
c ================================================================== |
24 |
|
25 |
implicit none |
26 |
|
27 |
c == global variables == |
28 |
|
29 |
#include "EEPARAMS.h" |
30 |
#include "SIZE.h" |
31 |
#include "PARAMS.h" |
32 |
#include "GRID.h" |
33 |
|
34 |
#include "cal.h" |
35 |
#include "ecco_cost.h" |
36 |
|
37 |
c == routine arguments == |
38 |
|
39 |
integer irec |
40 |
integer mythid |
41 |
|
42 |
c == local variables == |
43 |
|
44 |
integer bi,bj |
45 |
integer i,j,k |
46 |
integer itlo,ithi |
47 |
integer jtlo,jthi |
48 |
integer jmin,jmax |
49 |
integer imin,imax |
50 |
integer nobs |
51 |
integer tmirec |
52 |
integer begintmi |
53 |
integer beginrun |
54 |
|
55 |
_RL spval |
56 |
_RL vartile |
57 |
|
58 |
c == end of interface == |
59 |
|
60 |
parameter (spval = -9999. ) |
61 |
ce --> there is certainly a better place for this. |
62 |
|
63 |
jtlo = mybylo(mythid) |
64 |
jthi = mybyhi(mythid) |
65 |
itlo = mybxlo(mythid) |
66 |
ithi = mybxhi(mythid) |
67 |
jmin = 1 |
68 |
jmax = sny |
69 |
imin = 1 |
70 |
imax = snx |
71 |
|
72 |
begintmi = tmistartdate(1)/10000 |
73 |
beginrun = modelstartdate(1)/10000 |
74 |
if ( begintmi .eq. beginrun ) then |
75 |
tmirec = mod(modelstartdate(1)/100,100) - |
76 |
& mod(tmistartdate(1)/100,100) + irec |
77 |
else |
78 |
tmirec = ( beginrun - begintmi - 1)*nmonthyear + |
79 |
& (nmonthyear - mod(tmistartdate(1)/100,100) + |
80 |
& 1) + mod(modelstartdate(1)/100,100) - 1 + irec |
81 |
endif |
82 |
if (tmirec.gt.0) then |
83 |
call mdsreadfield( tmidatfile, cost_iprec, cost_yftype, 1, tmidat, |
84 |
& tmirec, mythid ) |
85 |
else |
86 |
do bj = jtlo,jthi |
87 |
do bi = itlo,ithi |
88 |
do j = jmin,jmax |
89 |
do i = imin,imax |
90 |
tmidat(i,j,bi,bj)=spval |
91 |
enddo |
92 |
enddo |
93 |
enddo |
94 |
enddo |
95 |
endif |
96 |
return |
97 |
end |
98 |
|