1 |
C $Header: /u/gcmpack/MITgcm/pkg/cost/cost_state_final.F,v 1.6 2009/04/28 18:08:13 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "COST_OPTIONS.h" |
5 |
|
6 |
subroutine cost_state_final( myThid ) |
7 |
C /==========================================================\ |
8 |
C | subroutine cost_state_final | |
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 |
|
20 |
#include "cost.h" |
21 |
|
22 |
C ======== Routine arguments ====================== |
23 |
C myThid - Thread number for this instance of the routine. |
24 |
integer myThid |
25 |
|
26 |
#ifdef ALLOW_COST_STATE_FINAL |
27 |
C ========= Local variables ========================= |
28 |
integer i, j, k |
29 |
integer bi, bj |
30 |
|
31 |
DO bj=myByLo(myThid),myByHi(myThid) |
32 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
33 |
DO j=1,sNy |
34 |
DO i=1,sNx |
35 |
DO k=1,nr |
36 |
objf_state_final(i,j,bi,bj,0*Nr+k) = theta(i,j,k,bi,bj) |
37 |
objf_state_final(i,j,bi,bj,1*Nr+k) = salt(i,j,k,bi,bj) |
38 |
objf_state_final(i,j,bi,bj,2*Nr+k) = uvel(i,j,k,bi,bj) |
39 |
objf_state_final(i,j,bi,bj,3*Nr+k) = vvel(i,j,k,bi,bj) |
40 |
END DO |
41 |
objf_state_final(i,j,bi,bj,4*Nr+1) = etan(i,j,bi,bj) |
42 |
END DO |
43 |
END DO |
44 |
END DO |
45 |
END DO |
46 |
|
47 |
cph fc = objf_state_final(45,4,1,1,1) |
48 |
cph _GLOBAL_SUM_RL( fc , myThid ) |
49 |
cph print *, 'fc for admtlm test at 83,33 : ', fc |
50 |
|
51 |
#endif |
52 |
|
53 |
end |