1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/aim_surf_bc.F,v 1.5 2004/04/08 00:14:09 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
6 |
|
7 |
CBOP |
8 |
C !ROUTINE: ATM_APPLY_IMPORT |
9 |
C !INTERFACE: |
10 |
SUBROUTINE ATM_APPLY_IMPORT( |
11 |
I land_frc, |
12 |
U aimTsoce, aimSIfrc, |
13 |
I myTime, myIter, bi, bj, myThid ) |
14 |
|
15 |
C !DESCRIPTION: \bv |
16 |
C *================================================================* |
17 |
C | S/R ATM_APPLY_IMPORT |
18 |
C | o Apply imported coupling data to AIM surface BC over ocean |
19 |
C *================================================================* |
20 |
C | Note: when using sea-ice, fill in Mixed layer fields instead |
21 |
C | to be used later as Atmos. + Sea-Ice surface oceanic BC. |
22 |
C *================================================================* |
23 |
C \ev |
24 |
|
25 |
C !USES: |
26 |
IMPLICIT NONE |
27 |
|
28 |
C == Global variables === |
29 |
#include "SIZE.h" |
30 |
#include "EEPARAMS.h" |
31 |
#include "PARAMS.h" |
32 |
#include "CPL_PARAMS.h" |
33 |
|
34 |
#ifdef ALLOW_THSICE |
35 |
# include "THSICE_VARS.h" |
36 |
#endif |
37 |
|
38 |
C-- Coupled to the Ocean : |
39 |
#include "ATMCPL.h" |
40 |
|
41 |
C !INPUT/OUTPUT PARAMETERS: |
42 |
C == Routine arguments == |
43 |
C land_frc :: land fraction [0-1] |
44 |
C aimTsoce :: sea surface temp [K], used in AIM |
45 |
C aimSIfrc :: sea-ice fraction [0-1] |
46 |
C myTime :: Current time of simulation ( s ) |
47 |
C myIter :: Current iteration number in simulation |
48 |
C bi,bj :: Tile index |
49 |
C myThid :: Number of this instance of the routine |
50 |
_RS land_frc(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
51 |
_RL aimTsoce(sNx,sNy) |
52 |
_RL aimSIfrc(sNx,sNy) |
53 |
_RL myTime |
54 |
INTEGER myIter, bi, bj, myThid |
55 |
CEOP |
56 |
|
57 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
58 |
|
59 |
#ifdef COMPONENT_MODULE |
60 |
C == Local variables == |
61 |
C i,j :: Loop counters |
62 |
INTEGER i,j |
63 |
|
64 |
#ifdef ALLOW_THSICE |
65 |
IF ( useThSIce ) THEN |
66 |
C-- Put fields from the ocean component in Mixed-layer arrays: |
67 |
|
68 |
C- fill in hOceMxL with Mixed-layer Depth from the ocean component |
69 |
IF ( useImportMxlD ) THEN |
70 |
DO j=1,sNy |
71 |
DO i=1,sNx |
72 |
IF ( land_frc(i,j,bi,bj) .LT. 1. ) THEN |
73 |
hOceMxL(i,j,bi,bj) = ocMxlD(i,j,bi,bj) |
74 |
ENDIF |
75 |
ENDDO |
76 |
ENDDO |
77 |
ENDIF |
78 |
|
79 |
C- fill in tOceMxL with Sea-Surface Temp. from the ocean component |
80 |
IF ( useImportSST ) THEN |
81 |
DO j=1,sNy |
82 |
DO i=1,sNx |
83 |
IF ( land_frc(i,j,bi,bj) .LT. 1. ) THEN |
84 |
tOceMxL(i,j,bi,bj) = SSTocn(i,j,bi,bj) |
85 |
ENDIF |
86 |
ENDDO |
87 |
ENDDO |
88 |
ENDIF |
89 |
|
90 |
C- fill in sOceMxL with Sea-Surf Salinity from the ocean component |
91 |
IF ( useImportSSS ) THEN |
92 |
DO j=1,sNy |
93 |
DO i=1,sNx |
94 |
IF ( land_frc(i,j,bi,bj) .LT. 1. ) THEN |
95 |
sOceMxL(i,j,bi,bj) = SSSocn(i,j,bi,bj) |
96 |
ENDIF |
97 |
ENDDO |
98 |
ENDDO |
99 |
ENDIF |
100 |
|
101 |
C- fill in v2ocMxL with surf. velocity^2 from the ocean component |
102 |
IF ( useImportVsq ) THEN |
103 |
DO j=1,sNy |
104 |
DO i=1,sNx |
105 |
IF ( land_frc(i,j,bi,bj) .LT. 1. ) THEN |
106 |
v2ocMxL(i,j,bi,bj) = vSqocn(i,j,bi,bj) |
107 |
ENDIF |
108 |
ENDDO |
109 |
ENDDO |
110 |
ENDIF |
111 |
|
112 |
ELSE |
113 |
#else |
114 |
IF (.TRUE.) THEN |
115 |
#endif /* ALLOW_THSICE */ |
116 |
|
117 |
IF ( useImportSST ) THEN |
118 |
DO j=1,sNy |
119 |
DO i=1,sNx |
120 |
IF ( land_frc(i,j,bi,bj) .LT. 1. ) THEN |
121 |
|
122 |
C-- take SST from the ocean compon where Sea-Ice fraction is zero |
123 |
IF ( aimSIfrc(i,j).EQ.0. ) THEN |
124 |
aimTsoce(i,j) = SSTocn(i,j,bi,bj)+celsius2K |
125 |
ELSEIF ( SSTocn(i,j,bi,bj).GE. -1. _d 0) THEN |
126 |
C-- take SST from the ocean compon if clearly warmer than freezing |
127 |
C then reset sea-ice fraction |
128 |
aimTsoce(i,j) = SSTocn(i,j,bi,bj)+celsius2K |
129 |
aimSIfrc(i,j) = 0. |
130 |
ENDIF |
131 |
|
132 |
ENDIF |
133 |
ENDDO |
134 |
ENDDO |
135 |
ENDIF |
136 |
|
137 |
C-- if useThSIce / else / endif |
138 |
ENDIF |
139 |
|
140 |
#endif /* COMPONENT_MODULE */ |
141 |
|
142 |
RETURN |
143 |
END |