1 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_map_exf.F,v 1.6 2008/11/07 20:43:16 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "THSICE_OPTIONS.h" |
5 |
#ifdef ALLOW_EXF |
6 |
#include "EXF_OPTIONS.h" |
7 |
#endif |
8 |
|
9 |
CBOP |
10 |
C !ROUTINE: THSICE_MAP_EXF |
11 |
C !INTERFACE: |
12 |
SUBROUTINE THSICE_MAP_EXF( |
13 |
I iceMsk, locSST, |
14 |
O totPrc, snowPrc, qPrcRnO, flxSW, |
15 |
I iMin,iMax,jMin,jMax, bi,bj, myThid ) |
16 |
C !DESCRIPTION: \bv |
17 |
C *==========================================================* |
18 |
C | S/R THSICE_MAP_EXF |
19 |
C | Interface S/R : map Precip, Snow and shortwave fluxes |
20 |
C | from pkg EXF to thsice variables |
21 |
C *==========================================================* |
22 |
C \ev |
23 |
|
24 |
C !USES: |
25 |
IMPLICIT NONE |
26 |
|
27 |
C == Global data == |
28 |
#include "SIZE.h" |
29 |
#include "EEPARAMS.h" |
30 |
#include "PARAMS.h" |
31 |
#include "FFIELDS.h" |
32 |
#ifdef ALLOW_EXF |
33 |
# include "EXF_CONSTANTS.h" |
34 |
# include "EXF_PARAM.h" |
35 |
# include "EXF_FIELDS.h" |
36 |
#endif |
37 |
|
38 |
C !INPUT/OUTPUT PARAMETERS: |
39 |
C === Routine arguments === |
40 |
C iceMsk :: sea-ice fraction: no ice=0, grid all ice 1 [] |
41 |
C locSST :: local Sea-Surface Temperature [deg.C] |
42 |
C totPrc :: Total Precipitation (including run-off) [kg/m2/s] |
43 |
C snowPrc :: Snow Precipitation [kg/m2/s] |
44 |
C qPrcRnO :: Energy content of Precip+RunOff (+=down) [W/m2] |
45 |
C flxSW :: Downward short-wave surface flux (+=down) [W/m2] |
46 |
C iMin,iMax :: range of indices of computation domain |
47 |
C jMin,jMax :: range of indices of computation domain |
48 |
C bi,bj :: current tile indices |
49 |
C myThid :: Thread no. that called this routine. |
50 |
_RL iceMsk (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
51 |
_RL locSST (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
52 |
_RL totPrc (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
53 |
_RL snowPrc(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
54 |
_RL qPrcRnO(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
55 |
_RL flxSW (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
56 |
INTEGER iMin,iMax |
57 |
INTEGER jMin,jMax |
58 |
INTEGER bi,bj |
59 |
INTEGER myThid |
60 |
CEOP |
61 |
|
62 |
#ifdef ALLOW_EXF |
63 |
|
64 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
65 |
C === Local variables === |
66 |
C i,j :: current grid point indices |
67 |
INTEGER i,j |
68 |
|
69 |
DO j = jMin, jMax |
70 |
DO i = iMin, iMax |
71 |
#ifdef ALLOW_ATM_TEMP |
72 |
totPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
73 |
#endif |
74 |
#ifdef ALLOW_RUNOFF |
75 |
totPrc(i,j) = totPrc(i,j) + runoff(i,j,bi,bj)*rhoConstFresh |
76 |
#else |
77 |
STOP 'ABNORMAL END: S/R THSICE_MAP_EXF: ALLOW_RUNOFF undef' |
78 |
#endif |
79 |
#ifdef ALLOW_DOWNWARD_RADIATION |
80 |
flxSW (i,j) = swdown(i,j,bi,bj) |
81 |
#else |
82 |
STOP 'ABNORMAL END: S/R THSICE_MAP_EXF: DOWNWARD_RADIATION undef' |
83 |
#endif |
84 |
ENDDO |
85 |
ENDDO |
86 |
|
87 |
#ifdef ALLOW_ATM_TEMP |
88 |
IF ( snowPrecipFile .NE. ' ' ) THEN |
89 |
DO j = jMin, jMax |
90 |
DO i = iMin, iMax |
91 |
snowPrc(i,j) = snowPrecip(i,j,bi,bj)*rhoConstFresh |
92 |
ENDDO |
93 |
ENDDO |
94 |
ELSE |
95 |
C If specific snow precipitiation is not available, use |
96 |
C precipitation when ever the air temperature is below 0 degC |
97 |
DO j = jMin, jMax |
98 |
DO i = iMin, iMax |
99 |
IF ( iceMsk(i,j,bi,bj).GT.0. _d 0 |
100 |
& .AND. atemp(i,j,bi,bj).LE.cen2kel ) THEN |
101 |
cML & .AND. atemp(i,j,bi,bj).LE.Tf0kel ) THEN |
102 |
snowPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
103 |
ENDIF |
104 |
ENDDO |
105 |
ENDDO |
106 |
ENDIF |
107 |
IF ( temp_EvPrRn .NE. UNSET_RL ) THEN |
108 |
C-- Account for energy content of Precip + RunOff : |
109 |
C assume 1) rain has same temp as Air (higher altitude, e.g., 850.mb would |
110 |
C be better); 2) Snow has no heat capacity (+ is counted separately) |
111 |
C 3) no distinction between sea-water Cp and fresh-water Cp |
112 |
C 4) Run-Off comes at the temp of surface water (with same Cp) |
113 |
DO j = jMin, jMax |
114 |
DO i = iMin, iMax |
115 |
qPrcRnO(i,j) = HeatCapacity_Cp |
116 |
& *( atemp(i,j,bi,bj) - cen2kel - temp_EvPrRn ) |
117 |
& *( precip(i,j,bi,bj)*rhoConstFresh - snowPrc(i,j) ) |
118 |
& |
119 |
#ifdef ALLOW_RUNOFF |
120 |
qPrcRnO(i,j) = qPrcRnO(i,j) |
121 |
& + HeatCapacity_Cp |
122 |
& *( locSST(i,j,bi,bj) - temp_EvPrRn ) |
123 |
& *runoff(i,j,bi,bj)*rhoConstFresh |
124 |
#endif |
125 |
ENDDO |
126 |
ENDDO |
127 |
ENDIF |
128 |
#else /* ALLOW_ATM_TEMP */ |
129 |
STOP 'ABNORMAL END: S/R THSICE_MAP_EXF: ATM_TEMP undef' |
130 |
#endif /* ALLOW_ATM_TEMP */ |
131 |
|
132 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
133 |
|
134 |
#endif /* ALLOW_EXF */ |
135 |
|
136 |
RETURN |
137 |
END |