21 |
c Christian Eckert eckert@mit.edu 12-Feb-2000 |
c Christian Eckert eckert@mit.edu 12-Feb-2000 |
22 |
c - Changed Routine names (package prefix: exf_) |
c - Changed Routine names (package prefix: exf_) |
23 |
c changed: heimbach@mit.edu 08-Feb-2002 |
c changed: heimbach@mit.edu 08-Feb-2002 |
24 |
c changed: menemenlis@jpl.nasa.gov 20-Dec-2002 |
c mods for pkg/seaice: menemenlis@jpl.nasa.gov 20-Dec-2002 |
25 |
c |
c |
26 |
c ================================================================== |
c ================================================================== |
27 |
c SUBROUTINE exf_set_climsst |
c SUBROUTINE exf_set_climsst |
57 |
|
|
58 |
c == end of interface == |
c == end of interface == |
59 |
|
|
60 |
|
if ( climsstfile .NE. ' ' ) then |
61 |
|
|
62 |
#ifdef ALLOW_CLIM_CYCLIC |
#ifdef ALLOW_CLIM_CYCLIC |
63 |
c record numbers are assumed 1 to 12 corresponding to |
c record numbers are assumed 1 to 12 corresponding to |
64 |
c Jan. through Dec. |
c Jan. through Dec. |
65 |
call cal_GetMonthsRec( |
call cal_GetMonthsRec( |
66 |
O fac, first, changed, |
O fac, first, changed, |
67 |
O count0, count1, |
O count0, count1, |
68 |
I mycurrenttime, mycurrentiter, mythid |
I mycurrenttime, mycurrentiter, mythid |
69 |
& ) |
& ) |
70 |
#else |
#else |
71 |
c get record numbers and interpolation factor for climsst |
c get record numbers and interpolation factor for climsst |
72 |
call exf_GetFFieldRec( |
call exf_GetFFieldRec( |
73 |
I climsststartdate, climsstperiod |
I climsststartdate, climsstperiod |
74 |
O , fac, first, changed |
O , fac, first, changed |
75 |
O , count0, count1 |
O , count0, count1 |
76 |
I , mycurrenttime, mycurrentiter, mythid |
I , mycurrenttime, mycurrentiter, mythid |
77 |
& ) |
& ) |
78 |
#endif |
#endif |
79 |
|
|
80 |
if ( first ) then |
if ( first ) then |
81 |
if ( climsstfile .NE. ' ' ) |
call mdsreadfield( climsstfile, exf_clim_iprec |
82 |
& call mdsreadfield( climsstfile, exf_clim_iprec |
& , exf_clim_yftype, 1 |
83 |
& , exf_clim_yftype, 1 |
& , climsst1, count0, mythid |
84 |
& , climsst1, count0, mythid |
& ) |
85 |
& ) |
if (exf_clim_yftype .eq. 'RL') then |
86 |
if (exf_clim_yftype .eq. 'RL') then |
call exf_filter_rl( climsst1, climsstmask, mythid ) |
87 |
call exf_filter_rl( climsst1, climsstmask, mythid ) |
else |
88 |
else |
call exf_filter_rs( climsst1, climsstmask, mythid ) |
89 |
call exf_filter_rs( climsst1, climsstmask, mythid ) |
end if |
90 |
end if |
endif |
91 |
endif |
|
92 |
|
if (( first ) .or. ( changed )) then |
93 |
if (( first ) .or. ( changed )) then |
call exf_SwapFFields( climsst0, climsst1, mythid ) |
94 |
call exf_SwapFFields( climsst0, climsst1, mythid ) |
call mdsreadfield( climsstfile, exf_clim_iprec |
95 |
|
& , exf_clim_yftype, 1 |
96 |
call mdsreadfield( climsstfile, exf_clim_iprec |
& , climsst1, count1, mythid |
97 |
& , exf_clim_yftype, 1 |
& ) |
98 |
& , climsst1, count1, mythid |
if (exf_clim_yftype .eq. 'RL') then |
99 |
& ) |
call exf_filter_rl( climsst1, climsstmask, mythid ) |
100 |
if (exf_clim_yftype .eq. 'RL') then |
else |
101 |
call exf_filter_rl( climsst1, climsstmask, mythid ) |
call exf_filter_rs( climsst1, climsstmask, mythid ) |
102 |
else |
end if |
103 |
call exf_filter_rs( climsst1, climsstmask, mythid ) |
endif |
|
end if |
|
|
endif |
|
104 |
|
|
105 |
c Loop over tiles. |
c Loop over tiles. |
106 |
do bj = mybylo(mythid),mybyhi(mythid) |
do bj = mybylo(mythid),mybyhi(mythid) |
107 |
do bi = mybxlo(mythid),mybxhi(mythid) |
do bi = mybxlo(mythid),mybxhi(mythid) |
108 |
do j = 1,sny |
do j = 1,sny |
109 |
do i = 1,snx |
do i = 1,snx |
110 |
|
|
111 |
c Set to freezing temperature if less |
c Set to freezing temperature if less |
112 |
if (climsst0(i,j,bi,bj) .lt. climtempfreeze) then |
if (climsst0(i,j,bi,bj) .lt. climtempfreeze) then |
113 |
climsst0(i,j,bi,bj) = climtempfreeze |
climsst0(i,j,bi,bj) = climtempfreeze |
114 |
endif |
endif |
115 |
if (climsst1(i,j,bi,bj) .lt. climtempfreeze) then |
if (climsst1(i,j,bi,bj) .lt. climtempfreeze) then |
116 |
climsst1(i,j,bi,bj) = climtempfreeze |
climsst1(i,j,bi,bj) = climtempfreeze |
117 |
endif |
endif |
118 |
|
|
119 |
c Interpolate linearly onto the current time. |
c Interpolate linearly onto the current time. |
120 |
climsst(i,j,bi,bj) = fac *climsst0(i,j,bi,bj)+ |
climsst(i,j,bi,bj) = exf_inscal_sst * ( |
121 |
& (exf_one - fac) *climsst1(i,j,bi,bj) |
& fac * climsst0(i,j,bi,bj) + |
122 |
|
& (exf_one - fac) * climsst1(i,j,bi,bj) ) |
123 |
|
|
124 |
|
enddo |
125 |
|
enddo |
126 |
enddo |
enddo |
127 |
enddo |
enddo |
128 |
enddo |
|
129 |
enddo |
endif |
130 |
|
|
131 |
#endif /* ALLOW_CLIMSST_RELAXATION */ |
#endif /* ALLOW_CLIMSST_RELAXATION */ |
132 |
|
|