/[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.6 - (show annotations) (download)
Tue Apr 28 18:08:13 2009 UTC (15 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint63p, checkpoint63q, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62, checkpoint63, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61n, checkpoint61o, checkpoint61m, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.5: +2 -2 lines
change macros (EXCH & GLOBAL_SUM/MAX) sufix _R4/_R8 to _RS/_RL
 when applied to _RS/_RL variable

1 C $Header: /u/gcmpack/MITgcm/pkg/admtlm/admtlm_metric.F,v 1.5 2007/10/08 23:45:51 jmc Exp $
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_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