/[MITgcm]/MITgcm/pkg/seaice/cost_ice_test.F
ViewVC logotype

Contents of /MITgcm/pkg/seaice/cost_ice_test.F

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


Revision 1.10 - (show annotations) (download)
Wed Mar 24 03:05:11 2010 UTC (14 years, 1 month ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint63, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.9: +17 -16 lines
add missing "_d 0"

1 C $Header: /u/gcmpack/MITgcm/pkg/seaice/cost_ice_test.F,v 1.9 2009/06/24 08:55:43 mlosch Exp $
2 C $Name: $
3
4 #include "SEAICE_OPTIONS.h"
5
6 subroutine cost_ice_test( mytime, myiter, mythid )
7
8 c ==================================================================
9 c SUBROUTINE cost_ice_test
10 c ==================================================================
11 c
12 c o Compute sea-ice cost function. The following options can be
13 c selected with data.seaice (SEAICE_PARM02) variable cost_ice_flag
14 c
15 c cost_ice_flag = 1
16 c - compute mean sea-ice volume
17 c costIceStart < mytime < costIceEnd
18 c
19 c cost_ice_flag = 2
20 c - compute mean sea-ice area
21 c costIceStart < mytime < costIceEnd
22 c
23 c cost_ice_flag = 3
24 c - heat content of top level plus latent heat of sea-ice
25 c costIceStart < mytime < costIceEnd
26 c
27 c cost_ice_flag = 4
28 c - heat content of top level
29 c costIceStart < mytime < costIceEnd
30 c
31 c cost_ice_flag = 5
32 c - heat content of top level plus sea-ice plus latent heat of snow
33 c costIceStart < mytime < costIceEnd
34 c
35 c cost_ice_flag = 6
36 c - quadratic cost function measuring difference between pkg/seaice
37 c AREA variable and simulated sea-ice measurements at every time
38 c step.
39 c
40 c ==================================================================
41 c
42 c started: menemenlis@jpl.nasa.gov 26-Feb-2003
43 c
44 c ==================================================================
45 c SUBROUTINE cost_ice_test
46 c ==================================================================
47
48 implicit none
49
50 c == global variables ==
51 #ifdef ALLOW_COST_ICE
52 #include "EEPARAMS.h"
53 #include "SIZE.h"
54 #include "GRID.h"
55 #include "PARAMS.h"
56 #include "SEAICE_COST.h"
57 #include "SEAICE.h"
58 #include "DYNVARS.h"
59 #include "cost.h"
60 #endif /* ALLOW_COST_ICE */
61
62 c == routine arguments ==
63
64 _RL mytime
65 integer myiter
66 integer mythid
67
68 #ifdef ALLOW_COST_ICE
69
70 c == local variables ==
71
72 c msgBuf - Informational/error message buffer
73 CHARACTER*(MAX_LEN_MBUF) msgBuf
74 integer bi,bj,i,j,kSrf
75 _RL tempVar
76
77 c == external functions ==
78
79 integer ilnblnk
80 external ilnblnk
81
82 c == end of interface ==
83
84 if ( myTime .GT. (endTime - lastinterval) ) then
85 tempVar = 1. _d 0/
86 & ( ( 1. _d 0 + min(endTime-startTime,lastinterval) )
87 & / deltaTClock )
88
89 kSrf = 1
90 cph(
91 print *, 'ph-ice B ', myiter, theta(4,4,kSrf,1,1),
92 & area(4,4,1,1), heff(4,4,1,1)
93 cph)
94 if ( cost_ice_flag .eq. 1 ) then
95 c sea-ice volume
96 do bj=myByLo(myThid),myByHi(myThid)
97 do bi=myBxLo(myThid),myBxHi(myThid)
98 do j = 1,sny
99 do i = 1,snx
100 objf_ice(bi,bj) = objf_ice(bi,bj) +
101 & tempVar * rA(i,j,bi,bj) * HEFF(i,j,bi,bj)
102 enddo
103 enddo
104 enddo
105 enddo
106
107 elseif ( cost_ice_flag .eq. 2 ) then
108 c sea-ice area
109 do bj=myByLo(myThid),myByHi(myThid)
110 do bi=myBxLo(myThid),myBxHi(myThid)
111 do j = 1,sny
112 do i = 1,snx
113 objf_ice(bi,bj) = objf_ice(bi,bj) +
114 & tempVar * rA(i,j,bi,bj) * AREA(i,j,bi,bj)
115 enddo
116 enddo
117 enddo
118 enddo
119
120 c heat content of top level:
121 c theta * delZ * (sea water heat capacity = 3996 J/kg/K)
122 c * (density of sea-water = 1026 kg/m^3)
123 c
124 c heat content of sea-ice:
125 c tice * heff * (sea ice heat capacity = 2090 J/kg/K)
126 c * (density of sea-ice = 910 kg/m^3)
127 c
128 c note: to remove mass contribution to heat content,
129 c which is not properly accounted for by volume converving
130 c ocean model, theta and tice are referenced to freezing
131 c temperature of sea-ice, here -1.96 deg C
132 c
133 c latent heat content of sea-ice:
134 c - heff * (latent heat of fusion = 334000 J/kg)
135 c * (density of sea-ice = 910 kg/m^3)
136 c
137 c latent heat content of snow:
138 c - hsnow * (latent heat of fusion = 334000 J/kg)
139 c * (density of snow = 330 kg/m^3)
140
141 elseif ( cost_ice_flag .eq. 3 ) then
142 c heat content of top level plus latent heat of sea-ice
143 do bj=myByLo(myThid),myByHi(myThid)
144 do bi=myBxLo(myThid),myBxHi(myThid)
145 do j = 1,sny
146 do i = 1,snx
147 objf_ice(bi,bj) = objf_ice(bi,bj) +
148 & tempVar * rA(i,j,bi,bj) * (
149 & (THETA(i,j,kSrf,bi,bj) + 1.96 _d 0 ) *
150 & drF(1) * 3996. _d 0 * 1026. _d 0 -
151 & HEFF(i,j,bi,bj) * 334000. _d 0 * 910. _d 0 )
152 enddo
153 enddo
154 enddo
155 enddo
156
157 elseif ( cost_ice_flag .eq. 4 ) then
158 c heat content of top level
159 do bj=myByLo(myThid),myByHi(myThid)
160 do bi=myBxLo(myThid),myBxHi(myThid)
161 do j = 1,sny
162 do i = 1,snx
163 objf_ice(bi,bj) = objf_ice(bi,bj) +
164 & tempVar * rA(i,j,bi,bj) * (
165 & (THETA(i,j,kSrf,bi,bj) + 1.96 _d 0 ) *
166 & drF(1) * 3996. _d 0 * 1026. _d 0 )
167 enddo
168 enddo
169 enddo
170 enddo
171
172 elseif ( cost_ice_flag .eq. 5 ) then
173 c heat content of top level plus sea-ice plus latent heat of snow
174 do bj=myByLo(myThid),myByHi(myThid)
175 do bi=myBxLo(myThid),myBxHi(myThid)
176 do j = 1,sny
177 do i = 1,snx
178 objf_ice(bi,bj) = objf_ice(bi,bj) +
179 & tempVar * rA(i,j,bi,bj) * (
180 & (THETA(i,j,kSrf,bi,bj) + 1.96 _d 0 ) *
181 & drF(1) * 3996. _d 0 * 1026. _d 0 +
182 & (TICE(i,j,bi,bj) - 273.15 _d 0 + 1.96 _d 0 ) *
183 & HEFF(i,j,bi,bj) * 2090. _d 0 * 910. _d 0 -
184 & HEFF(i,j,bi,bj) * 334000. _d 0 * 910. _d 0 -
185 & HSNOW(i,j,bi,bj) * 334000. _d 0 * 330. _d 0 )
186 enddo
187 enddo
188 enddo
189 enddo
190
191 elseif ( cost_ice_flag .eq. 6 ) then
192 c Qadratic cost function measuring difference between pkg/seaice
193 c AREA variable and simulated sea-ice measurements at every time
194 c step. For time being no measurements are read-in. It is
195 c assumed that measurements are AREA=0.5 at all times everywhere.
196 do bj=myByLo(myThid),myByHi(myThid)
197 do bi=myBxLo(myThid),myBxHi(myThid)
198 do j = 1,sny
199 do i = 1,snx
200 objf_ice(bi,bj) = objf_ice(bi,bj) +
201 & ( AREA(i,j,bi,bj) - 0.5 _d 0 ) *
202 & ( AREA(i,j,bi,bj) - 0.5 _d 0 )
203 enddo
204 enddo
205 enddo
206 enddo
207
208 else
209 WRITE(msgBuf,'(A)')
210 & 'COST_ICE: invalid cost_ice_flag'
211 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
212 & SQUEEZE_RIGHT , myThid )
213 STOP 'ABNORMAL END: S/R COST_ICE'
214 endif
215 endif
216
217 cph(
218 print *, 'ph-ice C ', myiter, objf_ice(1,1)
219 cph)
220
221 #endif /* ALLOW_COST_ICE */
222
223 return
224 end

  ViewVC Help
Powered by ViewVC 1.1.22