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