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

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

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


Revision 1.4 - (show annotations) (download)
Tue Feb 5 14:51:09 2013 UTC (11 years, 4 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint64x, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f
Changes since 1.3: +3 -1 lines
- add compile switches ALLOW_SHALLOW_ALTIMETRY and ALLOW_HIGHLAT_ALTIMETRY.

1 C $Header: /u/gcmpack/MITgcm/pkg/ecco/cost_sla_read_yd.F,v 1.3 2012/08/10 19:45:26 jmc Exp $
2 C $Name: $
3
4 #include "ECCO_OPTIONS.h"
5
6
7 subroutine cost_sla_read_yd( sla_file, sla_startdate,
8 c I sla_startdate, sla_period,
9 c I sla_intercept, sla_slope,
10 O sla_obs, sla_mask,
11 I year,day, mythid )
12
13 c ==================================================================
14 c SUBROUTINE cost_sla_read_yd
15 c ==================================================================
16 c
17 c o Read a given record of the SLA data.
18 c
19 c started: Gael Forget 20-Oct-2009
20 c
21 c ==================================================================
22 c SUBROUTINE cost_sla_read_yd
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 year,day
40 integer mythid
41
42 integer sla_startdate(4)
43 _RL sla_period
44 _RL sla_intercept
45 _RL sla_slope
46 _RL sla_obs (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
47 _RL sla_mask (1-olx:snx+olx,1-oly:sny+oly, nsx,nsy)
48 character*(MAX_LEN_FNAM) sla_file
49
50 c == local variables ==
51
52 integer bi,bj
53 integer i,j,k
54 integer itlo,ithi
55 integer jtlo,jthi
56 integer jmin,jmax
57 integer imin,imax
58 integer sshrec
59 integer difftime(4)
60 integer middate(4)
61 integer noffset
62 _RL diffsecs
63 _RL spval
64 _RL factor
65
66 cnew(
67 integer il
68 _RL daytime
69 integer dayiter
70 integer daydate(4)
71 integer yday, ymod
72 integer md, dd, sd, ld, wd
73 character*(80) fnametmp
74 logical exst
75 cnew)
76
77 c == external functions ==
78
79 integer ilnblnk
80 external ilnblnk
81
82 integer cal_IsLeap
83 external cal_IsLeap
84
85 c == end of interface ==
86
87 jtlo = mybylo(mythid)
88 jthi = mybyhi(mythid)
89 itlo = mybxlo(mythid)
90 ithi = mybxhi(mythid)
91 jmin = 1
92 jmax = sny
93 imin = 1
94 imax = snx
95
96 factor = 0.01
97 spval = -9990.
98
99 if ( (day.GE.1).AND.( (
100 & (cal_IsLeap(year,mythid).eq.2).AND.(day.LE.366)
101 & ).OR.(day.LE.365) ) ) then
102
103 il=ilnblnk(sla_file)
104
105 write(fnametmp(1:80),'(2a,i4)')
106 & sla_file(1:il), '_', year
107 inquire( file=fnametmp, exist=exst )
108 if (.NOT. exst) then
109 stop
110 endif
111
112 call mdsreadfield( fnametmp, cost_iprec, cost_yftype, 1, sla_obs,
113 & day, mythid )
114
115 do bj = jtlo,jthi
116 do bi = itlo,ithi
117 k = 1
118 do j = jmin,jmax
119 do i = imin,imax
120
121 if (_hFacC(i,j,k,bi,bj) .eq. 0.) then
122 sla_mask(i,j,bi,bj) = 0. _d 0
123 else
124 sla_mask(i,j,bi,bj) = 1. _d 0
125 endif
126 if (sla_obs(i,j,bi,bj) .le. spval) then
127 sla_mask(i,j,bi,bj) = 0. _d 0
128 endif
129 if (abs(sla_obs(i,j,bi,bj)) .lt. 1.d-8 ) then
130 sla_mask(i,j,bi,bj) = 0. _d 0
131 endif
132
133 cph(
134 #ifndef ALLOW_SHALLOW_ALTIMETRY
135 if ( R_low(i,j,bi,bj) .GT. -200. ) then
136 sla_mask(i,j,bi,bj) = 0. _d 0
137 endif
138 #endif
139 cph)
140
141 sla_mask(i,j,bi,bj) = sla_mask(i,j,bi,bj)*frame(i,j)
142 sla_obs(i,j,bi,bj) = sla_mask(i,j,bi,bj)*factor*
143 & sla_obs(i,j,bi,bj)
144
145 enddo
146 enddo
147 enddo
148 enddo
149
150 else !if ( (day.GE.1).AND...
151
152 do bj = jtlo,jthi
153 do bi = itlo,ithi
154 do j = jmin,jmax
155 do i = imin,imax
156 sla_obs(i,j,bi,bj) = 0. _d 0
157 sla_mask(i,j,bi,bj) = 0. _d 0
158 enddo
159 enddo
160 enddo
161 enddo
162
163 endif !if ( (day.GE.1).AND...
164
165 return
166 end
167

  ViewVC Help
Powered by ViewVC 1.1.22