/[MITgcm]/MITgcm/pkg/thsice/thsice_cost_test.F
ViewVC logotype

Contents of /MITgcm/pkg/thsice/thsice_cost_test.F

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


Revision 1.3 - (show annotations) (download)
Sat Jun 1 15:48:13 2013 UTC (10 years, 10 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64o, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint64n, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint64i, checkpoint64k, checkpoint65, checkpoint64j, checkpoint64m, checkpoint64l, HEAD
Changes since 1.2: +1 -9 lines
Clean up code.

1 C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_cost_test.F,v 1.2 2013/04/13 20:51:32 heimbach Exp $
2 C $Name: $
3
4 #include "THSICE_OPTIONS.h"
5
6 subroutine thsice_cost_test( mytime, myiter, mythid )
7
8 c ==================================================================
9 c SUBROUTINE thsice_cost_test
10 c ==================================================================
11 c
12 c o Compute sea-ice cost function. The following options can be
13 c selected with data.thsice (THSICE_PARM02) variable thsice_cost_ice_flag
14 c
15 c thsice_cost_ice_flag = 1
16 c - compute mean sea-ice volume
17 c costIceStart < mytime < costIceEnd
18 c
19 c thsice_cost_ice_flag = 2
20 c - compute mean sea-ice area
21 c costIceStart < mytime < costIceEnd
22 c
23 c thsice_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 thsice_cost_ice_flag = 4
28 c - heat content of top level
29 c costIceStart < mytime < costIceEnd
30 c
31 c thsice_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 thsice_cost_ice_flag = 6
36 c - quadratic cost function measuring difference between pkg/thsice
37 c AREA variable and simulated sea-ice measurements at every time
38 c step.
39 c
40 c ==================================================================
41 c SUBROUTINE thsice_cost_test
42 c ==================================================================
43
44 implicit none
45
46 c == global variables ==
47 #ifdef ALLOW_THSICE_COST_TEST
48 #include "EEPARAMS.h"
49 #include "SIZE.h"
50 #include "GRID.h"
51 #include "PARAMS.h"
52 #include "THSICE_SIZE.h"
53 #include "THSICE_COST.h"
54 #include "THSICE_VARS.h"
55 #include "DYNVARS.h"
56 #include "cost.h"
57 #endif /* ALLOW_THSICE_COST_TEST */
58
59 c == routine arguments ==
60
61 _RL mytime
62 integer myiter
63 integer mythid
64
65 #ifdef ALLOW_THSICE_COST_TEST
66
67 c == local variables ==
68
69 c msgBuf - Informational/error message buffer
70 CHARACTER*(MAX_LEN_MBUF) msgBuf
71 integer bi,bj,i,j,kSrf
72 _RL tempVar
73
74 c == external functions ==
75
76 integer ilnblnk
77 external ilnblnk
78
79 c == end of interface ==
80
81 if ( myTime .GT. (endTime - lastinterval) ) then
82 tempVar = 1. _d 0/
83 & ( ( 1. _d 0 + min(endTime-startTime,lastinterval) )
84 & / deltaTClock )
85
86 kSrf = 1
87
88 if ( thsice_cost_ice_flag .eq. 1 ) then
89 c sea-ice volume
90 do bj=myByLo(myThid),myByHi(myThid)
91 do bi=myBxLo(myThid),myBxHi(myThid)
92 do j = 1,sny
93 do i = 1,snx
94 objf_thsice(bi,bj) = objf_thsice(bi,bj) +
95 & tempVar*rA(i,j,bi,bj)*iceHeight(i,j,bi,bj)
96 enddo
97 enddo
98 enddo
99 enddo
100
101 elseif ( thsice_cost_ice_flag .eq. 2 ) then
102 c sea-ice area
103 do bj=myByLo(myThid),myByHi(myThid)
104 do bi=myBxLo(myThid),myBxHi(myThid)
105 do j = 1,sny
106 do i = 1,snx
107 objf_thsice(bi,bj) = objf_thsice(bi,bj) +
108 & tempVar*rA(i,j,bi,bj)*iceMask(i,j,bi,bj)
109 enddo
110 enddo
111 enddo
112 enddo
113
114 else
115 WRITE(msgBuf,'(A)')
116 & 'THSICE_COST_TEST: invalid thsice_cost_ice_flag'
117 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
118 & SQUEEZE_RIGHT , myThid )
119 STOP 'ABNORMAL END: S/R THSICE_COST_TEST'
120 endif
121 endif
122
123 #endif /* ALLOW_THSICE_COST_TEST */
124
125 return
126 end

  ViewVC Help
Powered by ViewVC 1.1.22