65 |
|
|
66 |
c == end of interface == |
c == end of interface == |
67 |
|
|
68 |
|
#ifdef ALLOW_CLIM_CYCLIC |
69 |
|
c record numbers are assumed 1 to 12 corresponding to |
70 |
|
c Jan. through Dec. |
71 |
|
call cal_GetMonthsRec( |
72 |
|
O fac, first, changed, |
73 |
|
O count0, count1, |
74 |
|
I mycurrenttime, mycurrentiter, mythid |
75 |
|
& ) |
76 |
|
#else |
77 |
c get record numbers and interpolation factor for climsalt |
c get record numbers and interpolation factor for climsalt |
78 |
call exf_GetFFieldRec( |
call exf_GetFFieldRec( |
79 |
I climsaltstartdate, climsaltperiod |
I climsaltstartdate, climsaltperiod |
81 |
O , count0, count1 |
O , count0, count1 |
82 |
I , mycurrenttime, mycurrentiter, mythid |
I , mycurrenttime, mycurrentiter, mythid |
83 |
& ) |
& ) |
84 |
|
#endif |
85 |
|
|
86 |
|
#ifndef ALLOW_AUTODIFF_TAMC |
87 |
if ( first ) then |
if ( first ) then |
88 |
|
#endif |
89 |
call mdsreadfield( climsaltfile, exf_clim_iprec |
call mdsreadfield( climsaltfile, exf_clim_iprec |
90 |
& , exf_clim_yftype, nr |
& , exf_clim_yftype, nr |
91 |
& , climsalt1, count0, mythid |
& , climsalt1, count0, mythid |
95 |
else |
else |
96 |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
97 |
end if |
end if |
98 |
|
#ifndef ALLOW_AUTODIFF_TAMC |
99 |
endif |
endif |
100 |
|
#endif |
101 |
|
|
102 |
|
#ifndef ALLOW_AUTODIFF_TAMC |
103 |
if (( first ) .or. ( changed )) then |
if (( first ) .or. ( changed )) then |
104 |
|
#endif |
105 |
call exf_SwapFFields_3d( climsalt0, climsalt1, mythid ) |
call exf_SwapFFields_3d( climsalt0, climsalt1, mythid ) |
106 |
|
|
107 |
call mdsreadfield( climsaltfile, exf_clim_iprec |
call mdsreadfield( climsaltfile, exf_clim_iprec |
113 |
else |
else |
114 |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
call exf_filter_rs( climsalt1, climsaltmask, mythid ) |
115 |
end if |
end if |
116 |
|
#ifndef ALLOW_AUTODIFF_TAMC |
117 |
endif |
endif |
118 |
|
#endif |
119 |
|
|
120 |
c Loop over tiles. |
c Loop over tiles. |
121 |
do bj = mybylo(mythid),mybyhi(mythid) |
do bj = mybylo(mythid),mybyhi(mythid) |
125 |
do i = 1-olx,snx+olx |
do i = 1-olx,snx+olx |
126 |
|
|
127 |
c Set to freezing salterature if less |
c Set to freezing salterature if less |
128 |
if (climsalt0(i,j,bi,bj) .lt. climsaltfreeze) then |
if (climsalt0(i,j,k,bi,bj) .lt. climsaltfreeze) then |
129 |
climsalt0(i,j,bi,bj) = climsaltfreeze |
climsalt0(i,j,k,bi,bj) = climsaltfreeze |
130 |
endif |
endif |
131 |
if (climsalt1(i,j,bi,bj) .lt. climsaltfreeze) then |
if (climsalt1(i,j,k,bi,bj) .lt. climsaltfreeze) then |
132 |
climsalt1(i,j,bi,bj) = climsaltfreeze |
climsalt1(i,j,k,bi,bj) = climsaltfreeze |
133 |
endif |
endif |
134 |
|
|
135 |
c Interpolate linearly onto the current time. |
c Interpolate linearly onto the current time. |