1 |
mlosch |
1.1 |
C $Header: $ |
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, |
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 |
|
|
# 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 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_THSICE |
59 |
|
|
#ifdef ALLOW_EXF |
60 |
|
|
|
61 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
62 |
|
|
C === Local variables === |
63 |
|
|
C i,j :: current grid point indices |
64 |
|
|
INTEGER i,j |
65 |
|
|
|
66 |
|
|
DO j = jMin, jMax |
67 |
|
|
DO i = iMin, iMax |
68 |
|
|
totPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
69 |
|
|
#if defined (ALLOW_RUNOFF) || defined (ALLOW_SEAICE) |
70 |
|
|
totPrc(i,j) = totPrc(i,j) + runoff(i,j,bi,bj)*rhoConstFresh |
71 |
|
|
#endif |
72 |
|
|
CML flxSW (i,j) = -Qsw(i,j,bi,bj) |
73 |
|
|
flxSW (i,j) = swdown(i,j,bi,bj) |
74 |
|
|
ENDDO |
75 |
|
|
ENDDO |
76 |
|
|
|
77 |
|
|
IF ( snowPrecipFile .NE. ' ' ) THEN |
78 |
|
|
DO j = jMin, jMax |
79 |
|
|
DO i = iMin, iMax |
80 |
|
|
snowPrc(i,j) = snowPrecip(i,j,bi,bj)*rhoConstFresh |
81 |
|
|
ENDDO |
82 |
|
|
ENDDO |
83 |
|
|
ELSE |
84 |
|
|
C If specific snow precipitiation is now available, use |
85 |
|
|
C precipitation when ever the air temperature is below 0 degC |
86 |
|
|
DO j = jMin, jMax |
87 |
|
|
DO i = iMin, iMax |
88 |
|
|
IF ( iceMsk(i,j,bi,bj).GT.0. _d 0 |
89 |
|
|
& .AND. atemp(i,j,bi,bj).LE.cen2kel ) THEN |
90 |
|
|
CML & .AND. atemp(i,j,bi,bj).LE.Tf0kel ) THEN |
91 |
|
|
snowPrc(i,j) = precip(i,j,bi,bj)*rhoConstFresh |
92 |
|
|
ENDIF |
93 |
|
|
ENDDO |
94 |
|
|
ENDDO |
95 |
|
|
ENDIF |
96 |
|
|
|
97 |
|
|
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
98 |
|
|
|
99 |
|
|
#endif /* ALLOW_EXF */ |
100 |
|
|
#endif /* ALLOW_THSICE */ |
101 |
|
|
|
102 |
|
|
RETURN |
103 |
|
|
END |