1 |
c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_filter_rs.F,v 1.1.4.1 2002/11/07 17:07:56 heimbach Exp $ |
2 |
|
3 |
#include "EXF_CPPOPTIONS.h" |
4 |
|
5 |
subroutine exf_filter_rs( |
6 |
I arr, |
7 |
I ckind, |
8 |
I mythid |
9 |
& ) |
10 |
|
11 |
c ================================================================== |
12 |
c SUBROUTINE exf_filter_rs |
13 |
c ================================================================== |
14 |
c |
15 |
c o Read a flux record for external forcing. |
16 |
c |
17 |
c started: Ralf.Giering@FastOpt.de 24-Mai-2000 |
18 |
c |
19 |
c ================================================================== |
20 |
c SUBROUTINE exf_filter_rs |
21 |
c ================================================================== |
22 |
|
23 |
implicit none |
24 |
|
25 |
c == global variables == |
26 |
|
27 |
#include "EEPARAMS.h" |
28 |
#include "SIZE.h" |
29 |
#include "GRID.h" |
30 |
#include "exf_constants.h" |
31 |
#include "exf.h" |
32 |
#include "exf_param.h" |
33 |
|
34 |
c == routine arguments == |
35 |
|
36 |
_RS arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
37 |
character*1 ckind |
38 |
integer mythid |
39 |
|
40 |
c == local variables == |
41 |
|
42 |
integer bi,bj |
43 |
integer i,j |
44 |
integer itlo,ithi |
45 |
integer jtlo,jthi |
46 |
|
47 |
c == end of interface == |
48 |
|
49 |
jtlo = mybylo(mythid) |
50 |
jthi = mybyhi(mythid) |
51 |
itlo = mybxlo(mythid) |
52 |
ithi = mybxhi(mythid) |
53 |
|
54 |
c filter forcing field array |
55 |
do bj = jtlo,jthi |
56 |
do bi = itlo,ithi |
57 |
|
58 |
c Set undefined values to zero. |
59 |
crg not necessary and |
60 |
crg would require additional intermediate results in adjoint |
61 |
crg do j = 1,sny |
62 |
crg do i = 1,snx |
63 |
crg if (arr(i,j,bi,bj) .le. exf_undef) then |
64 |
crg arr(i,j,bi,bj) = 0. _d 0 |
65 |
crg endif |
66 |
crg enddo |
67 |
crg enddo |
68 |
|
69 |
c Set land points to zero |
70 |
if (ckind .eq. 's') then |
71 |
|
72 |
do j = 1,sny |
73 |
do i = 1,snx |
74 |
if ( _hFacC(i,j,1,bi,bj) .eq. 0. ) then |
75 |
arr(i,j,bi,bj) = 0. _d 0 |
76 |
endif |
77 |
enddo |
78 |
enddo |
79 |
|
80 |
else if (ckind .eq. 'u') then |
81 |
|
82 |
do j = 1,sny |
83 |
do i = 1,snx |
84 |
if ( maskw(i,j,1,bi,bj) .eq. 0. ) then |
85 |
arr(i,j,bi,bj) = 0. _d 0 |
86 |
endif |
87 |
enddo |
88 |
enddo |
89 |
|
90 |
else if (ckind .eq. 'v') then |
91 |
|
92 |
do j = 1,sny |
93 |
do i = 1,snx |
94 |
if ( masks(i,j,1,bi,bj) .eq. 0. ) then |
95 |
arr(i,j,bi,bj) = 0. _d 0 |
96 |
endif |
97 |
enddo |
98 |
enddo |
99 |
|
100 |
end if |
101 |
|
102 |
enddo |
103 |
enddo |
104 |
|
105 |
end |