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 |