/[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.7 - (show annotations) (download)
Sun Aug 12 18:29:25 2012 UTC (11 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63r, checkpoint63s, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, 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, HEAD
Changes since 1.6: +2 -2 lines
new option-file for this package, included in all *.F files

1 C $Header: /u/gcmpack/MITgcm/pkg/admtlm/admtlm_metric.F,v 1.6 2009/04/28 18:08:13 jmc Exp $
2 C $Name: $
3
4 #include "ADMTLM_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_RL( 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