1 |
jmc |
1.3 |
C $Header: /u/gcmpack/MITgcm/pkg/thsice/thsice_map_exf.F,v 1.2 2007/04/16 23:37:48 jmc Exp $ |
2 |
mlosch |
1.1 |
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, |
14 |
|
|
O totPrc, snowPrc, 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 |
jmc |
1.2 |
# include "EXF_CONSTANTS.h" |
34 |
|
|
# include "EXF_PARAM.h" |
35 |
|
|
# include "EXF_FIELDS.h" |
36 |
mlosch |
1.1 |
#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 totPrc :: Total Precipitation (including run-off) [kg/m2/s] |
42 |
|
|
C snowPrc :: Snow Precipitation [kg/m2/s] |
43 |
|
|
C flxSW :: Net short-wave surface flux (+=down) [W/m2] |
44 |
|
|
C iMin,iMax :: range of indices of computation domain |
45 |
|
|
C jMin,jMax :: range of indices of computation domain |
46 |
|
|
C bi,bj :: current tile indices |
47 |
|
|
C myThid :: Thread no. that called this routine. |
48 |
|
|
_RL iceMsk (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
49 |
|
|
_RL totPrc (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
50 |
|
|
_RL snowPrc(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
51 |
|
|
_RL flxSW (1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
52 |
|
|
INTEGER iMin,iMax |
53 |
|
|
INTEGER jMin,jMax |
54 |
|
|
INTEGER bi,bj |
55 |
|
|
INTEGER myThid |
56 |
|
|
CEOP |
57 |
|
|
|
58 |
|
|
#ifdef ALLOW_EXF |
59 |
|
|
|
60 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
61 |
|
|
C === Local variables === |
62 |
|
|
C i,j :: current grid point indices |
63 |
|
|
INTEGER i,j |
64 |
|
|
|
65 |
|
|
DO j = jMin, jMax |
66 |
|
|
DO i = iMin, iMax |
67 |
jmc |
1.3 |
#ifdef ALLOW_ATM_TEMP |
68 |
mlosch |
1.1 |
totPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
69 |
jmc |
1.3 |
#endif |
70 |
mlosch |
1.1 |
#if defined (ALLOW_RUNOFF) || defined (ALLOW_SEAICE) |
71 |
|
|
totPrc(i,j) = totPrc(i,j) + runoff(i,j,bi,bj)*rhoConstFresh |
72 |
|
|
#endif |
73 |
|
|
CML flxSW (i,j) = -Qsw(i,j,bi,bj) |
74 |
jmc |
1.3 |
#ifdef ALLOW_DOWNWARD_RADIATION |
75 |
mlosch |
1.1 |
flxSW (i,j) = swdown(i,j,bi,bj) |
76 |
jmc |
1.3 |
#else |
77 |
|
|
STOP 'ABNORMAL END: S/R THSICE_MAP_EXF: DOWNWARD_RADIATION undef' |
78 |
|
|
#endif |
79 |
mlosch |
1.1 |
ENDDO |
80 |
|
|
ENDDO |
81 |
|
|
|
82 |
jmc |
1.3 |
#ifdef ALLOW_ATM_TEMP |
83 |
mlosch |
1.1 |
IF ( snowPrecipFile .NE. ' ' ) THEN |
84 |
|
|
DO j = jMin, jMax |
85 |
|
|
DO i = iMin, iMax |
86 |
|
|
snowPrc(i,j) = snowPrecip(i,j,bi,bj)*rhoConstFresh |
87 |
|
|
ENDDO |
88 |
|
|
ENDDO |
89 |
|
|
ELSE |
90 |
|
|
C If specific snow precipitiation is now available, use |
91 |
|
|
C precipitation when ever the air temperature is below 0 degC |
92 |
|
|
DO j = jMin, jMax |
93 |
|
|
DO i = iMin, iMax |
94 |
|
|
IF ( iceMsk(i,j,bi,bj).GT.0. _d 0 |
95 |
|
|
& .AND. atemp(i,j,bi,bj).LE.cen2kel ) THEN |
96 |
|
|
CML & .AND. atemp(i,j,bi,bj).LE.Tf0kel ) THEN |
97 |
|
|
snowPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
98 |
|
|
ENDIF |
99 |
|
|
ENDDO |
100 |
|
|
ENDDO |
101 |
|
|
ENDIF |
102 |
jmc |
1.3 |
#else /* ALLOW_ATM_TEMP */ |
103 |
|
|
STOP 'ABNORMAL END: S/R THSICE_MAP_EXF: ATM_TEMP undef' |
104 |
|
|
#endif /* ALLOW_ATM_TEMP */ |
105 |
mlosch |
1.1 |
|
106 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
107 |
|
|
|
108 |
|
|
#endif /* ALLOW_EXF */ |
109 |
|
|
|
110 |
|
|
RETURN |
111 |
|
|
END |