/[MITgcm]/MITgcm/pkg/admtlm/admtlm_metric.F
ViewVC logotype

Contents of /MITgcm/pkg/admtlm/admtlm_metric.F

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


Revision 1.5 - (show annotations) (download)
Mon Oct 8 23:45:51 2007 UTC (16 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint60, checkpoint61, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59k, checkpoint59j, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61l, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i
Changes since 1.4: +5 -3 lines
add missing cvs $Header:$ or $Name:$

1 C $Header: $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 subroutine admtlm_metric( myThid )
7 C /==========================================================\
8 C | subroutine admtlm_metric |
9 C | o This routine assigns final T,S to cost function |
10 C \==========================================================/
11 implicit none
12
13 C == Global variables ===
14 #include "SIZE.h"
15 #include "EEPARAMS.h"
16 #include "PARAMS.h"
17 #include "GRID.h"
18 #include "DYNVARS.h"
19 #ifdef ALLOW_ADMTLM
20 # include "cost.h"
21 # include "g_cost.h"
22 # include "optim.h"
23 #endif
24
25 C ======== Routine arguments ======================
26 C myThid - Thread number for this instance of the routine.
27 integer myThid
28
29 #ifdef ALLOW_ADMTLM
30 C ========= Local variables =========================
31 integer i, j, k
32 integer bi, bj
33 _RL myMetric
34 _RL stdDevSST
35 _RL stdDevSSS
36 _RL stdDevtheta
37 _RL stdDevsalt
38 _RL stdDevuvel
39 _RL stdDevvvel
40 _RL stdDevetan
41
42 myMetric = 0. _d 0
43 stdDevSST = 0.52 _d 0
44 stdDevSSS = 0.134 _d 0
45 stdDevtheta = 1.
46 stdDevsalt = 1.
47 stdDevuvel = 1.
48 stdDevvvel = 1.
49 stdDevetan = 1.
50
51 DO bj=myByLo(myThid),myByHi(myThid)
52 DO bi=myBxLo(myThid),myBxHi(myThid)
53 DO j=1,sNy
54 DO i=1,sNx
55 DO k=1,Nr
56 myMetric = myMetric
57 & + g_objf_state_final(i,j,bi,bj,k+0*Nr)**2/stdDevtheta**2
58 & + g_objf_state_final(i,j,bi,bj,k+1*Nr)**2/stdDevsalt**2
59 & + g_objf_state_final(i,j,bi,bj,k+2*Nr)**2/stdDevuvel**2
60 & + g_objf_state_final(i,j,bi,bj,k+3*Nr)**2/stdDevvvel**2
61 END DO
62 myMetric = myMetric
63 & + g_objf_state_final(i,j,bi,bj,1+4*Nr)**2/stdDevetan**2
64 END DO
65 END DO
66 END DO
67 END DO
68
69 _GLOBAL_SUM_R8( myMetric , myThid )
70 myMetric = myMetric/(nx*ny*(4*Nr+1))
71
72 cph(
73 DO bj=myByLo(myThid),myByHi(myThid)
74 DO bi=myBxLo(myThid),myBxHi(myThid)
75 DO j=1,sNy
76 DO i=1,sNx
77 c print '(a,2I4,2(x,F15.9))', 'ph-metric T ', i, j,
78 c & g_objf_state_final(i,j,bi,bj,1),
79 c & g_objf_state_final(i,j,bi,bj,1)**2 / stdDevSST**2
80 c print '(a,2I4,2(x,F15.9))', 'ph-metric S ', i, j,
81 c & g_objf_state_final(i,j,bi,bj,2),
82 c & g_objf_state_final(i,j,bi,bj,2)**2 / stdDevSSS**2
83 END DO
84 END DO
85 END DO
86 END DO
87
88 print *, 'ph-admtlm myMetric = ', optimcycle, myMetric
89
90 cph)
91
92 #endif
93
94 end

  ViewVC Help
Powered by ViewVC 1.1.22