58 |
|
|
59 |
c == end of interface == |
c == end of interface == |
60 |
|
|
61 |
|
if ( climsaltfile .NE. ' ' ) then |
62 |
|
|
63 |
#ifdef ALLOW_CLIM_CYCLIC |
#ifdef ALLOW_CLIM_CYCLIC |
64 |
c record numbers are assumed 1 to 12 corresponding to |
c record numbers are assumed 1 to 12 corresponding to |
65 |
c Jan. through Dec. |
c Jan. through Dec. |
66 |
call cal_GetMonthsRec( |
call cal_GetMonthsRec( |
67 |
O fac, first, changed, |
O fac, first, changed, |
68 |
O count0, count1, |
O count0, count1, |
69 |
I mycurrenttime, mycurrentiter, mythid |
I mycurrenttime, mycurrentiter, mythid |
70 |
& ) |
& ) |
71 |
#else |
#else |
72 |
c get record numbers and interpolation factor for climsalt |
c get record numbers and interpolation factor for climsalt |
73 |
call exf_GetFFieldRec( |
call exf_GetFFieldRec( |
74 |
I climsaltstartdate, climsaltperiod |
I climsaltstartdate, climsaltperiod |
75 |
O , fac, first, changed |
O , fac, first, changed |
76 |
O , count0, count1 |
O , count0, count1 |
77 |
I , mycurrenttime, mycurrentiter, mythid |
I , mycurrenttime, mycurrentiter, mythid |
78 |
& ) |
& ) |
79 |
#endif |
#endif |
80 |
|
|
81 |
if ( first ) then |
if ( first ) then |
82 |
if ( climsaltfile .NE. ' ' ) |
call mdsreadfield( climsaltfile, exf_clim_iprec |
83 |
& call mdsreadfield( climsaltfile, exf_clim_iprec |
& , exf_clim_yftype, nr |
84 |
& , exf_clim_yftype, nr |
& , climsalt1, count0, mythid |
85 |
& , climsalt1, count0, mythid |
& ) |
86 |
& ) |
if (exf_clim_yftype .eq. 'RL') then |
87 |
if (exf_clim_yftype .eq. 'RL') then |
call exf_filter_rl( climsalt1, climsaltmask, mythid ) |
88 |
call exf_filter_rl( climsalt1, climsaltmask, mythid ) |
else |
89 |
else |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
90 |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
end if |
91 |
end if |
endif |
92 |
endif |
|
93 |
|
if (( first ) .or. ( changed )) then |
94 |
|
call exf_SwapFFields_3d( climsalt0, climsalt1, mythid ) |
95 |
|
|
96 |
|
call mdsreadfield( climsaltfile, exf_clim_iprec |
97 |
|
& , exf_clim_yftype, nr |
98 |
|
& , climsalt1, count1, mythid |
99 |
|
& ) |
100 |
|
if (exf_clim_yftype .eq. 'RL') then |
101 |
|
call exf_filter_rl( climsalt1, climsaltmask, mythid ) |
102 |
|
else |
103 |
|
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
104 |
|
end if |
105 |
|
endif |
106 |
|
|
107 |
if (( first ) .or. ( changed )) then |
c Loop over tiles. |
108 |
call exf_SwapFFields_3d( climsalt0, climsalt1, mythid ) |
do bj = mybylo(mythid),mybyhi(mythid) |
109 |
|
do bi = mybxlo(mythid),mybxhi(mythid) |
110 |
|
do k = 1,nr |
111 |
|
do j = 1-oly,sny+oly |
112 |
|
do i = 1-olx,snx+olx |
113 |
|
|
114 |
|
c Interpolate linearly onto the current time. |
115 |
|
climsalt(i,j,k,bi,bj) = |
116 |
|
& fac * climsalt0(i,j,k,bi,bj) + |
117 |
|
& (exf_one - fac) * climsalt1(i,j,k,bi,bj) |
118 |
|
|
119 |
|
enddo |
120 |
|
enddo |
121 |
|
enddo |
122 |
|
enddo |
123 |
|
enddo |
124 |
|
|
|
if ( climsaltfile .NE. ' ' ) |
|
|
& call mdsreadfield( climsaltfile, exf_clim_iprec |
|
|
& , exf_clim_yftype, nr |
|
|
& , climsalt1, count1, mythid |
|
|
& ) |
|
|
if (exf_clim_yftype .eq. 'RL') then |
|
|
call exf_filter_rl( climsalt1, climsaltmask, mythid ) |
|
|
else |
|
|
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
|
|
end if |
|
125 |
endif |
endif |
126 |
|
|
|
c Loop over tiles. |
|
|
do bj = mybylo(mythid),mybyhi(mythid) |
|
|
do bi = mybxlo(mythid),mybxhi(mythid) |
|
|
do k = 1,nr |
|
|
do j = 1-oly,sny+oly |
|
|
do i = 1-olx,snx+olx |
|
|
|
|
|
c Interpolate linearly onto the current time. |
|
|
climsalt(i,j,k,bi,bj) = |
|
|
& fac *climsalt0(i,j,k,bi,bj)+ |
|
|
& (exf_one - fac) *climsalt1(i,j,k,bi,bj) |
|
|
|
|
|
enddo |
|
|
enddo |
|
|
enddo |
|
|
enddo |
|
|
enddo |
|
|
|
|
127 |
#endif /* ALLOW_CLIMSALT_RELAXATION */ |
#endif /* ALLOW_CLIMSALT_RELAXATION */ |
128 |
|
|
129 |
end |
end |