/[MITgcm]/MITgcm/pkg/ecco/cost_readgfo.F
ViewVC logotype

Contents of /MITgcm/pkg/ecco/cost_readgfo.F

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


Revision 1.5 - (show annotations) (download)
Tue Oct 9 00:02:50 2007 UTC (16 years, 7 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61p
Changes since 1.4: +8 -7 lines
add missing cvs $Header:$ or $Name:$

1 C $Header: $
2 C $Name: $
3
4 #include "COST_CPPOPTIONS.h"
5
6
7 subroutine cost_readgfo( irec, mythid )
8
9 c ==================================================================
10 c SUBROUTINE cost_readgfo
11 c ==================================================================
12 c
13 c o Read a given record of the GFO SSH data.
14 c
15 c started: Christian Eckert eckert@mit.edu 25-May-1999
16 c
17 c changed: Christian Eckert eckert@mit.edu 25-Feb-2000
18 c
19 c - Restructured the code in order to create a package
20 c for the MITgcmUV.
21 c
22 c ==================================================================
23 c SUBROUTINE cost_readgfo
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 #ifdef ALLOW_SSH_GFOANOM_COST_CONTRIBUTION
44 c == local variables ==
45
46 integer bi,bj
47 integer i,j,k
48 integer itlo,ithi
49 integer jtlo,jthi
50 integer jmin,jmax
51 integer imin,imax
52 integer sshrec
53 integer difftime(4)
54 integer middate(4)
55 integer noffset
56 _RL diffsecs
57 _RL spval
58 _RL factor
59
60 cnew(
61 integer il
62 _RL daytime
63 integer dayiter
64 integer daydate(4)
65 integer yday, ymod
66 integer md, dd, sd, ld, wd
67 character*(80) fnametmp
68 logical exst
69 cnew)
70
71 c == external functions ==
72
73 integer ilnblnk
74 external ilnblnk
75
76 c == end of interface ==
77
78 jtlo = mybylo(mythid)
79 jthi = mybyhi(mythid)
80 itlo = mybxlo(mythid)
81 ithi = mybxhi(mythid)
82 jmin = 1
83 jmax = sny
84 imin = 1
85 imax = snx
86
87 factor = 0.01
88 spval = -9990.
89
90 cnew(
91 daytime = FLOAT(secondsperday*(irec-1)) + modelstart
92 dayiter = hoursperday*(irec-1)+modeliter0
93 call cal_getdate( dayiter, daytime, daydate, mythid )
94 call cal_convdate( daydate,yday,md,dd,sd,ld,wd,mythid )
95 ymod = gfostartdate(1)/10000
96
97 if ( ymod .EQ. yday ) then
98 middate(1) = modelstartdate(1)
99 else
100 middate(1) = yday*10000+100+1
101 endif
102 middate(2) = 0
103 middate(3) = modelstartdate(3)
104 middate(4) = modelstartdate(4)
105
106 call cal_TimePassed( middate, daydate, difftime, mythid )
107 call cal_ToSeconds( difftime, diffsecs, mythid )
108 sshrec = int(diffsecs/gfoperiod) + 1
109
110 il=ilnblnk(gfofile)
111 write(fnametmp(1:80),'(2a,i4)')
112 & gfofile(1:il), '_', yday
113 inquire( file=fnametmp, exist=exst )
114 if (.NOT. exst) then
115 write(fnametmp(1:80),'(a)') gfofile(1:il)
116 sshrec = irec
117 endif
118
119 cnew)
120
121
122 call mdsreadfield( fnametmp, cost_iprec, cost_yftype, 1, gfoobs,
123 & sshrec, mythid )
124
125
126 do bj = jtlo,jthi
127 do bi = itlo,ithi
128 k = 1
129 do j = jmin,jmax
130 do i = imin,imax
131 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
132 gfomask(i,j,bi,bj) = 0. _d 0
133 else
134 gfomask(i,j,bi,bj) = 1. _d 0
135 endif
136 if (gfoobs(i,j,bi,bj) .le. spval) then
137 gfomask(i,j,bi,bj) = 0. _d 0
138 endif
139 if (abs(gfoobs(i,j,bi,bj)) .lt. 1.d-8 ) then
140 gfomask(i,j,bi,bj) = 0. _d 0
141 endif
142
143 cph(
144 cph print *, 'WARNING: SPECIFIC SETUP FOR ECCO'
145 cph below statement could be replaced by following
146 cph to make it independnet of Nr:
147 cph
148 cph if ( rC(K) .GT. -1000. ) then
149 cph)
150 c set tpmask=0 in areas shallower than 1000m
151 if (_hFacC(i,j,13,bi,bj) .eq. 0.) then
152 gfomask(i,j,bi,bj) = 0. _d 0
153 endif
154
155 gfomask(i,j,bi,bj) = gfomask(i,j,bi,bj)*frame(i,j)
156 gfoobs(i,j,bi,bj) = gfomask(i,j,bi,bj)*factor*
157 & ( gfoobs(i,j,bi,bj) -
158 & ( gfointercept + gfoslope*irec*hoursperday ) )
159 enddo
160 enddo
161 enddo
162 enddo
163
164 #endif
165
166 return
167 end
168

  ViewVC Help
Powered by ViewVC 1.1.22