/[MITgcm]/MITgcm/pkg/dic/dic_cost.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_cost.F

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


Revision 1.3 - (show annotations) (download)
Thu Oct 9 04:19:19 2003 UTC (20 years, 6 months ago) by edhill
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint52l_pre, checkpoint52e_pre, hrcube4, checkpoint52n_post, checkpoint52j_post, checkpoint53d_post, checkpoint54a_pre, checkpoint51o_pre, checkpoint52e_post, checkpoint51n_pre, checkpoint54a_post, checkpoint53c_post, checkpoint51l_post, checkpoint51q_post, hrcube_1, branch-netcdf, checkpoint52d_pre, checkpoint52l_post, checkpoint51r_post, checkpoint52k_post, checkpoint52b_pre, checkpoint54b_post, checkpoint53b_pre, checkpoint52m_post, checkpoint53a_post, checkpoint54, checkpoint53b_post, checkpoint51o_post, checkpoint51p_post, checkpoint52a_pre, checkpoint51i_post, checkpoint53, checkpoint52, checkpoint52d_post, checkpoint52a_post, checkpoint52b_post, checkpoint53g_post, checkpoint52f_post, checkpoint52c_post, checkpoint51l_pre, ecco_c52_e35, hrcube5, checkpoint52i_post, checkpoint52j_pre, checkpoint53f_post, checkpoint51t_post, checkpoint53d_pre, checkpoint51n_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, hrcube_2, hrcube_3, checkpoint51m_post, checkpoint51s_post
Branch point for: branch-nonh, tg2-branch, checkpoint51n_branch, netcdf-sm0
Changes since 1.2: +1 -1 lines
 o first check-in for the "branch-genmake2" merge
 o verification suite as run on shelley (gcc 3.2.2):

Wed Oct  8 23:42:29 EDT 2003
                T           S           U           V
G D M    c        m  s        m  s        m  s        m  s
E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .
N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d
2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .

OPTFILE=NONE

Y Y Y Y 13 16 16 16  0 16 16 16 16 16 16 16 16 13 12  0  0 pass  adjustment.128x64x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16  0  0 16 16  0  0 pass  adjustment.cs-32x32x1
Y Y Y Y 16 16 16 16  0 16 16 16 16 16 16 22  0 16 16 22  0 pass  adjust_nlfs.cs-32x32x1
Y Y Y Y -- 13 13 16 16 13 13 13 13 16 16 16 16 16 16 16 16 N/O   advect_cs
Y Y Y Y -- 22 16 16 16 16 16 16 13 16 16 16 16 16 16 16 16 N/O   advect_xy
Y Y Y Y -- 13 16 13 16 16 16 16 16 16 16 22 16 16 16 16 16 N/O   advect_xz
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  aim.5l_cs
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 16 16 16 16 13 16 pass  aim.5l_Equatorial_Channel
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 13 16 16 13 13 16 pass  aim.5l_LatLon
Y Y Y Y 13 16 16 16 16 16 16 16 16 16 13 12 13 13 16 13 16 pass  exp0
Y Y Y Y 14 16 16 16 16 16 16 16 22 16 16 16 13 16 16 22 16 pass  exp1
Y Y Y Y 13 13 16 13 16 16 16 16 16 13 13 16 16 13 13 13 13 pass  exp2
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  exp4
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 22 16 16 16 22 16 pass  exp5
Y Y Y Y 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 pass  front_relax
Y Y Y Y 14 16 16 13 13 16 16 13 13 16 13 13 16 12 13 13 16 pass  global_ocean.90x40x15
Y Y Y Y 10 16 16 13 13 16 13 16 16 13 13 13 13 16 16 13 16 FAIL  global_ocean.cs32x15
Y Y Y Y  6 11 12 13 13 12 13 16 13  9  9  9  9 10  9  9 11 FAIL  global_ocean_pressure
Y Y Y Y 14 16 16 13 16 16 16 13 13 13 13 13 16 12 16 13 16 pass  global_with_exf
Y Y Y Y 14 16 16 16 16 16 16 16 16 11 13 22 13 16 16  9 16 pass  hs94.128x64x5
Y Y Y Y 13 16 16 16 16 16 16 16 16 11 16 16 16 13 16 22 13 pass  hs94.1x64x5
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 16 13 13 16 16 22 13 pass  hs94.cs-32x32x5
Y Y Y Y 10 10 16 13 13 16 16 16 22 16 13 13 13 13 13 22 13 FAIL  ideal_2D_oce
Y Y Y Y  8 16 16 16 16 16 16 16 16 13 13  8 16 16 16 16 16 FAIL  internal_wave
Y Y Y Y 14 16 16 16 16 16 16 16 16 13 13 22 13 13 13 22 16 pass  inverted_barometer
Y Y Y Y 12 16 16 16 16 16 16 16 16 16 13 12 13 13 13 13 13 FAIL  lab_sea
Y Y Y Y 11 16 16 16 16 16 16 16 13 13 13 12 13 16 13 12 13 FAIL  natl_box
Y Y Y Y 16 16 16 16 16 16 16 16 22 16 16 16 16 16 16 16 16 pass  plume_on_slope
Y Y Y Y 13 16 16 16 16 13 16 16 16 16 16 16 16 13 16 16 16 pass  solid-body.cs-32x32x1

1 cswdcost -- add sunroutine ---
2 #include "DIC_OPTIONS.h"
3 #include "GCHEM_OPTIONS.h"
4
5
6 CStartOfInterFace
7 SUBROUTINE DIC_COST (
8 I myTime,myIter,myThid)
9
10 C /==========================================================\
11 C | SUBROUTINE DIC_COST i |
12 C |==========================================================|
13 IMPLICIT NONE
14
15 C == GLobal variables ==
16 #include "SIZE.h"
17 #include "DYNVARS.h"
18 #include "EEPARAMS.h"
19 #include "PARAMS.h"
20 #include "GRID.h"
21 #include "PTRACERS.h"
22 #include "GCHEM.h"
23 #include "DIC_ABIOTIC.h"
24 #ifdef DIC_BIOTIC
25 #include "DIC_BIOTIC.h"
26 #include "DIC_DIAGS.h"
27 #include "DIC_COST.h"
28 #endif
29 #ifdef ALLOW_SEAICE
30 #include "ICE.h"
31 #endif
32
33 C == Routine arguments ==
34 INTEGER myIter
35 _RL myTime
36 INTEGER myThid
37
38 #ifdef ALLOW_DIC_COST
39
40 C == Local variables ==
41 LOGICAL DIFFERENT_MULTIPLE
42 EXTERNAL DIFFERENT_MULTIPLE
43 INTEGER i, j, bi, bj, k, it
44 c
45 _RL po4cost, o2cost, sumvol
46 _RL po4costm, o2costm, sumvolm
47 c
48 c calculate costfunction
49
50 _BEGIN_MASTER(myThid)
51
52 sumvol= 0. _d 0
53 po4cost= 0. _d 0
54 o2cost=0.d0
55 cswdmonth-add--
56 sumvolm=0.d0
57 po4costm=0.d0
58 o2costm=0.d0
59 cswdmonth -- end add --
60
61 DO bj=myByLo(myThid),myByHi(myThid)
62 DO bi=myBxLo(myThid),myBxHi(myThid)
63 DO i=1,sNx
64 DO j=1,sNy
65 do k=1,nR
66 sumvol=sumvol+
67 & rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)
68 po4cost=po4cost+
69 & (po4ann(i,j,k,bi,bj)-po4obs(i,j,k,bi,bj))**2
70 & /po4var(k)
71 & *rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)
72 o2cost=o2cost+
73 & (o2ann(i,j,k,bi,bj)-o2obs(i,j,k,bi,bj))**2
74 & /o2var(k)
75 & *rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)
76 enddo
77 cswdmonth-add--
78 do k=1,4
79 sumvolm=sumvolm+
80 & rA(i,j,bi,bj)*drF(k)*maskC(i,j,k,bi,bj)
81 enddo
82 do it=1,12
83 po4costm=po4costm+
84 & (po4lev1(i,j,it,bi,bj)-po4obsl1(i,j,it,bi,bj))**2
85 & /po4varm(it,1)
86 & *rA(i,j,bi,bj)*drF(1)*maskC(i,j,1,bi,bj) +
87 & (po4lev2(i,j,it,bi,bj)-po4obsl2(i,j,it,bi,bj))**2
88 & /po4varm(it,2)
89 & *rA(i,j,bi,bj)*drF(2)*maskC(i,j,2,bi,bj) +
90 & (po4lev3(i,j,it,bi,bj)-po4obsl3(i,j,it,bi,bj))**2
91 & /po4varm(it,3)
92 & *rA(i,j,bi,bj)*drF(3)*maskC(i,j,3,bi,bj)
93 cQQ & (po4lev4(i,j,it,bi,bj)-po4obsl4(i,j,it,bi,bj))**2
94 cQQ & /po4varm(it,4)
95 cQQ & *rA(i,j,bi,bj)*drF(4)*maskC(i,j,4,bi,bj)
96 o2costm=o2costm+
97 & (o2lev1(i,j,it,bi,bj)-o2obsl1(i,j,it,bi,bj))**2
98 & /o2varm(it,1)
99 & *rA(i,j,bi,bj)*drF(1)*maskC(i,j,1,bi,bj) +
100 & (o2lev2(i,j,it,bi,bj)-o2obsl2(i,j,it,bi,bj))**2
101 & /o2varm(it,2)
102 & *rA(i,j,bi,bj)*drF(2)*maskC(i,j,2,bi,bj) +
103 & (o2lev3(i,j,it,bi,bj)-o2obsl3(i,j,it,bi,bj))**2
104 & /o2varm(it,3)
105 & *rA(i,j,bi,bj)*drF(3)*maskC(i,j,3,bi,bj)
106 cQQ & (O2lev4(i,j,it,bi,bj)-o2obsl4(i,j,it,bi,bj))**2
107 cQQ & /o2varm(it,4)
108 cQQ & *rA(i,j,bi,bj)*drF(4)*maskC(i,j,4,bi,bj)
109
110 enddo
111 cswdmonth -end-
112 ENDDO
113 ENDDO
114 ENDDO
115 ENDDO
116 po4cost=po4cost/sumvol
117 o2cost=o2cost/sumvol
118 cswdmonth-add
119 po4costm=po4costm/sumvolm/12.d0
120 o2costm=o2costm/sumvolm/12.d0
121 cswdmonth-end
122 totcost=po4cost+o2cost+po4costm+o2costm
123
124 print*,'COST ',totcost, po4cost, o2cost,po4costm,o2costm
125
126 _END_MASTER(myThid)
127 c
128 #endif
129 RETURN
130 END
131 cswd -- end added subroutine --

  ViewVC Help
Powered by ViewVC 1.1.22