/[MITgcm]/MITgcm/pkg/exf/exf_set_climsst.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_set_climsst.F

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


Revision 1.3 - (show annotations) (download)
Tue Nov 12 20:34:41 2002 UTC (21 years, 6 months ago) by heimbach
Branch: MAIN
CVS Tags: branch-exfmods-tag, checkpoint47e_post, checkpoint47, checkpoint47c_post, checkpoint47d_post, checkpoint47a_post, checkpoint46n_post, checkpoint47b_post, checkpoint47d_pre
Branch point for: branch-exfmods-curt
Changes since 1.2: +6 -26 lines
Merging from release1_p8:
o exf:
  updated external forcing package
  - bug fixes carried over from ecco-branch
    (missing OBCS_OPTIONS.h in two routines)
  - enable easy to use "no forcing".
  - added exf I/O for atmospheric loading
  - added exf I/O for runoff data
  - transfered scaling between exf <-> MITgcm to exf namelist
  - removing old exfa stuff

1 c $Header: /u/gcmpack/MITgcm/pkg/exf/exf_set_climsst.F,v 1.1.4.2 2002/11/07 17:07:57 heimbach Exp $
2
3 #include "EXF_CPPOPTIONS.h"
4
5
6 subroutine exf_set_climsst(
7 O mycurrenttime
8 I , mycurrentiter
9 I , mythid
10 & )
11
12 c ==================================================================
13 c SUBROUTINE exf_set_climsst
14 c ==================================================================
15 c
16 c o Get the current climatological sea surface salinity field.
17 c started: Christian Eckert eckert@mit.edu 27-Aug-1999
18 c changed: Christian Eckert eckert@mit.edu 11-Jan-2000
19 c - Restructured the code in order to create a package
20 c for the MITgcmUV.
21 c Christian Eckert eckert@mit.edu 12-Feb-2000
22 c - Changed Routine names (package prefix: exf_)
23 c changed: heimbach@mit.edu 08-Feb-2002
24 c
25 c ==================================================================
26 c SUBROUTINE exf_set_climsst
27 c ==================================================================
28
29 implicit none
30
31 #include "EEPARAMS.h"
32 #include "SIZE.h"
33 #include "GRID.h"
34
35 #include "exf_param.h"
36 #include "exf_constants.h"
37 #include "exf_clim_param.h"
38 #include "exf_clim_fields.h"
39
40 c == routine arguments ==
41
42 _RL mycurrenttime
43 integer mycurrentiter
44 integer mythid
45
46 #ifdef ALLOW_CLIMSST_RELAXATION
47
48 c == local variables ==
49
50 logical first, changed
51 integer count0, count1
52 _RL fac
53
54 integer bi, bj
55 integer i, j
56
57 c == end of interface ==
58
59 #ifdef ALLOW_CLIM_CYCLIC
60 c record numbers are assumed 1 to 12 corresponding to
61 c Jan. through Dec.
62 call cal_GetMonthsRec(
63 O fac, first, changed,
64 O count0, count1,
65 I mycurrenttime, mycurrentiter, mythid
66 & )
67 #else
68 c get record numbers and interpolation factor for climsst
69 call exf_GetFFieldRec(
70 I climsststartdate, climsstperiod
71 O , fac, first, changed
72 O , count0, count1
73 I , mycurrenttime, mycurrentiter, mythid
74 & )
75 #endif
76
77 if ( first ) then
78 if ( climsstfile .NE. ' ' )
79 & call mdsreadfield( climsstfile, exf_clim_iprec
80 & , exf_clim_yftype, 1
81 & , climsst1, count0, mythid
82 & )
83 if (exf_clim_yftype .eq. 'RL') then
84 call exf_filter_rl( climsst1, climsstmask, mythid )
85 else
86 call exf_filter_rs( climsst1, climsstmask, mythid )
87 end if
88 endif
89
90 if (( first ) .or. ( changed )) then
91 call exf_SwapFFields( climsst0, climsst1, mythid )
92
93 call mdsreadfield( climsstfile, exf_clim_iprec
94 & , exf_clim_yftype, 1
95 & , climsst1, count1, mythid
96 & )
97 if (exf_clim_yftype .eq. 'RL') then
98 call exf_filter_rl( climsst1, climsstmask, mythid )
99 else
100 call exf_filter_rs( climsst1, climsstmask, mythid )
101 end if
102 endif
103
104 c Loop over tiles.
105 do bj = mybylo(mythid),mybyhi(mythid)
106 do bi = mybxlo(mythid),mybxhi(mythid)
107 do j = 1-oly,sny+oly
108 do i = 1-olx,snx+olx
109
110 c Set to freezing temperature if less
111 if (climsst0(i,j,bi,bj) .lt. climtempfreeze) then
112 climsst0(i,j,bi,bj) = climtempfreeze
113 endif
114 if (climsst1(i,j,bi,bj) .lt. climtempfreeze) then
115 climsst1(i,j,bi,bj) = climtempfreeze
116 endif
117
118 c Interpolate linearly onto the current time.
119 climsst(i,j,bi,bj) = fac *climsst0(i,j,bi,bj)+
120 & (exf_one - fac) *climsst1(i,j,bi,bj)
121
122 enddo
123 enddo
124 enddo
125 enddo
126
127 #endif /* ALLOW_CLIMSST_RELAXATION */
128
129 end
130
131
132 subroutine exf_init_climsst(
133 I mythid
134 & )
135
136 c ==================================================================
137 c SUBROUTINE exf_init_climsst
138 c ==================================================================
139 c
140 c o
141 c
142 c started: Ralf.Giering@FastOpt.de 25-Mai-2000
143 c
144 c ==================================================================
145 c SUBROUTINE exf_init_climsst
146 c ==================================================================
147
148 implicit none
149
150 c == global variables ==
151
152 #include "EEPARAMS.h"
153 #include "SIZE.h"
154
155 #include "exf_fields.h"
156 #include "exf_param.h"
157 #include "exf_clim_param.h"
158 #include "exf_clim_fields.h"
159
160 c == routine arguments ==
161
162 integer mythid
163
164 #ifdef ALLOW_CLIMSST_RELAXATION
165
166 c == local variables ==
167
168 integer bi, bj
169 integer i, j
170
171 c == end of interface ==
172
173 do bj = mybylo(mythid), mybyhi(mythid)
174 do bi = mybxlo(mythid), mybxhi(mythid)
175 do j = 1, sny
176 do i = 1, snx
177 climsst (i,j,bi,bj) = 0. _d 0
178 climsst0(i,j,bi,bj) = 0. _d 0
179 climsst1(i,j,bi,bj) = 0. _d 0
180 enddo
181 enddo
182 enddo
183 enddo
184
185 #endif /* ALLOW_CLIMSSST_RELAXATION */
186
187 end

  ViewVC Help
Powered by ViewVC 1.1.22