/[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.4 - (show annotations) (download)
Fri Apr 29 10:36:45 2005 UTC (19 years, 2 months ago) by heimbach
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59h, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post
Changes since 1.3: +26 -10 lines
o Extend svd to full state.
o Pass control variables as arguments.

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

  ViewVC Help
Powered by ViewVC 1.1.22