1 |
C $Header: /u/gcmpack/MITgcm/pkg/ocn_compon_interf/ocn_store_my_data.F,v 1.1 2004/05/21 19:42:26 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CStartOfInterface |
7 |
SUBROUTINE OCN_STORE_MY_DATA( |
8 |
I myTime, myIter, bi,bj, myThid ) |
9 |
C /==========================================================\ |
10 |
C | SUBROUTINE OCN_STORE_MY_DATA | |
11 |
C | o Routine for controlling storage of coupling data to | |
12 |
C | to the coupling layer. | |
13 |
C |==========================================================| |
14 |
C | This version talks to the MIT Coupler. It uses the MIT | |
15 |
C | Coupler "checkpoint1" library calls. | |
16 |
C \==========================================================/ |
17 |
IMPLICIT NONE |
18 |
|
19 |
C == Global variables == |
20 |
#include "SIZE.h" |
21 |
#include "EEPARAMS.h" |
22 |
#include "PARAMS.h" |
23 |
#include "CPL_PARAMS.h" |
24 |
#include "GRID.h" |
25 |
#include "SURFACE.h" |
26 |
#include "DYNVARS.h" |
27 |
#include "OCNCPL.h" |
28 |
|
29 |
C == Routine arguments == |
30 |
C myTime - Current internal time. |
31 |
C myIter - Current timestep number. |
32 |
C bi,bj - Current tile indices |
33 |
C myThid - Thread number for this instance of the routine |
34 |
_RL myTime |
35 |
INTEGER myIter |
36 |
INTEGER bi,bj |
37 |
INTEGER myThid |
38 |
|
39 |
|
40 |
CEndOfInterface |
41 |
|
42 |
C == Local variables == |
43 |
C i,j :: Loop variables |
44 |
INTEGER i,j |
45 |
|
46 |
IF ( cpl_earlyExpImpCall ) THEN |
47 |
DO j=1,sNy |
48 |
DO i=1,sNx |
49 |
SSTocn2cpl(i,j,bi,bj) = theta(i,j,1,bi,bj) |
50 |
SSSocn2cpl(i,j,bi,bj) = salt (i,j,1,bi,bj) |
51 |
ENDDO |
52 |
ENDDO |
53 |
ELSE |
54 |
DO j=1,sNy |
55 |
DO i=1,sNx |
56 |
SSTocn2cpl(i,j,bi,bj) = gT(i,j,1,bi,bj) |
57 |
SSSocn2cpl(i,j,bi,bj) = gS(i,j,1,bi,bj) |
58 |
ENDDO |
59 |
ENDDO |
60 |
ENDIF |
61 |
#ifdef NONLIN_FRSURF |
62 |
IF ( nonlinFreeSurf.GT.0 .AND. |
63 |
& (staggerTimeStep .OR. .NOT.cpl_earlyExpImpCall ) ) THEN |
64 |
IF ( select_rStar.GT.0 ) THEN |
65 |
DO j=1,sNy |
66 |
DO i=1,sNx |
67 |
ocMxlD2cpl(i,j,bi,bj) = |
68 |
& h0FacC(i,j,1,bi,bj)*rStarFacC(i,j,bi,bj)*drF(1) |
69 |
ENDDO |
70 |
ENDDO |
71 |
ELSE |
72 |
DO j=1,sNy |
73 |
DO i=1,sNx |
74 |
ocMxlD2cpl(i,j,bi,bj) = hFac_surfC(i,j,bi,bj)*drF(1) |
75 |
ENDDO |
76 |
ENDDO |
77 |
ENDIF |
78 |
ELSE |
79 |
#else /* NONLIN_FRSURF */ |
80 |
IF (.TRUE.) THEN |
81 |
#endif /* NONLIN_FRSURF */ |
82 |
DO j=1,sNy |
83 |
DO i=1,sNx |
84 |
ocMxlD2cpl(i,j,bi,bj) = hFacC(i,j,1,bi,bj)*drF(1) |
85 |
ENDDO |
86 |
ENDDO |
87 |
ENDIF |
88 |
|
89 |
DO j=1,sNy |
90 |
DO i=1,sNx |
91 |
vSqocn2cpl(i,j,bi,bj) = |
92 |
& ( uVel(i , j,1,bi,bj)*uVel(i , j,1,bi,bj) |
93 |
& + uVel(i+1,j,1,bi,bj)*uVel(i+1,j,1,bi,bj) |
94 |
& + vVel(i,j+1,1,bi,bj)*vVel(i,j+1,1,bi,bj) |
95 |
& + vVel(i,j , 1,bi,bj)*vVel(i,j , 1,bi,bj) |
96 |
& )*0.5 _d 0 |
97 |
ENDDO |
98 |
ENDDO |
99 |
|
100 |
RETURN |
101 |
END |