1 |
C $Header: /u/gcmpack/MITgcm/pkg/aim_v23/phy_suflux_post.F,v 1.2 2004/04/08 00:14:09 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "AIM_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: SUFLUX_POST |
8 |
C !INTERFACE: |
9 |
SUBROUTINE SUFLUX_POST( |
10 |
I FMASK, EMISloc, |
11 |
I TLAND, TSEA, TSICE, dTskin, SLRD, |
12 |
I T0, Q0, DENVV, |
13 |
U DRAG, SHF, EVAP, SLRup, |
14 |
O SLRU, TSFC, TSKIN, |
15 |
I bi,bj,myThid) |
16 |
|
17 |
C !DESCRIPTION: \bv |
18 |
C *==========================================================* |
19 |
C | S/R SUFLUX_POST |
20 |
C | o finish surface flux calculation |
21 |
C *==========================================================* |
22 |
C | o contain 2nd part of original S/R SUFLUX (Speedy code) |
23 |
C *==========================================================* |
24 |
C-- |
25 |
C-- SUBROUTINE SUFLUX (PSA,UA,VA,TA,QA,RH,PHI, |
26 |
C-- & PHI0,FMASK,TLAND,TSEA,SWAV,SSR,SLRD, |
27 |
C-- & USTR,VSTR,SHF,EVAP,SLRU, |
28 |
C-- & TSFC,TSKIN,U0,V0,T0,Q0) |
29 |
C-- |
30 |
C-- Purpose: Compute surface fluxes of momentum, energy and moisture, |
31 |
C-- and define surface skin temperature from energy balance |
32 |
C *==========================================================* |
33 |
C \ev |
34 |
|
35 |
C !USES: |
36 |
IMPLICIT NONE |
37 |
|
38 |
C Resolution parameters |
39 |
|
40 |
C-- size for MITgcm & Physics package : |
41 |
#include "AIM_SIZE.h" |
42 |
|
43 |
#include "EEPARAMS.h" |
44 |
#include "GRID.h" |
45 |
|
46 |
C Physical constants + functions of sigma and latitude |
47 |
#include "com_physcon.h" |
48 |
|
49 |
C Surface flux constants |
50 |
#include "com_sflcon.h" |
51 |
|
52 |
C !INPUT/OUTPUT PARAMETERS: |
53 |
C == Routine Arguments == |
54 |
C-- Input: |
55 |
C FMASK :: fraction land - sea - sea-ice (2.5-dim) |
56 |
C EMISloc:: longwave surface emissivity |
57 |
C TLAND :: land-surface temperature (2-dim) |
58 |
C TSEA :: sea-surface temperature (2-dim) |
59 |
C TSICE :: sea-ice surface temperature (2-dim) |
60 |
C dTskin :: temp. correction for daily-cycle heating [K] |
61 |
C SLRD :: sfc lw radiation (downward flux)(2-dim) |
62 |
C SSR :: sfc sw radiation (net flux) (2-dim) |
63 |
C T0 :: near-surface air temperature (2-dim) |
64 |
C Q0 :: near-surface sp. humidity [g/kg](2-dim) |
65 |
C DENVV :: surface flux (sens,lat.) coeff. (=Rho*|V|) [kg/m2/s] |
66 |
C-- Output: |
67 |
C DRAG :: surface Drag term (= Cd*Rho*|V|)(2-dim) |
68 |
C SHF :: sensible heat flux (2-dim) |
69 |
C EVAP :: evaporation [g/(m^2 s)] (2-dim) |
70 |
C SLRU :: sfc lw radiation (upward flux) (2-dim) |
71 |
C SLRup :: same, for each surface type (2-dim) |
72 |
C TSFC :: surface temperature (clim.) (2-dim) |
73 |
C TSKIN :: skin surface temperature (2-dim) |
74 |
C-- Input: |
75 |
C bi,bj :: tile index |
76 |
C myThid :: Thread number for this instance of the routine |
77 |
C-- |
78 |
_RL FMASK(NGP,3), EMISloc |
79 |
_RL TLAND(NGP), TSEA(NGP), TSICE(NGP), dTskin(NGP), SLRD(NGP) |
80 |
_RL T0(NGP), Q0(NGP), DENVV(NGP) |
81 |
|
82 |
_RL DRAG(NGP,0:3), SHF(NGP,0:3), EVAP(NGP,0:3), SLRup(NGP,3) |
83 |
_RL SLRU(NGP), TSFC(NGP), TSKIN(NGP) |
84 |
|
85 |
INTEGER bi,bj,myThid |
86 |
CEOP |
87 |
|
88 |
#ifdef ALLOW_AIM |
89 |
|
90 |
C-- Local variables: |
91 |
C J,i1,j1 :: Loop counters |
92 |
C msgBuf :: Informational/error message buffer |
93 |
INTEGER J,i1,j1 |
94 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
95 |
|
96 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
97 |
|
98 |
C-- 1. Extrapolation of wind, temp, hum. and density to the surface |
99 |
|
100 |
C-- 2. Computation of fluxes over land and sea |
101 |
|
102 |
C-- 3. Adjustment of skin temperature and fluxes over land |
103 |
C-- based on energy balance (to be implemented) |
104 |
|
105 |
|
106 |
C-- 4. Weighted average of surface fluxes and temperatures |
107 |
C-- according to land-sea mask |
108 |
|
109 |
DO J=1,NGP |
110 |
c USTR(J,3) = USTR(J,2)+FMASK(J,1)*(USTR(J,1)-USTR(J,2)) |
111 |
c VSTR(J,3) = VSTR(J,2)+FMASK(J,1)*(VSTR(J,1)-VSTR(J,2)) |
112 |
c DRAG(J,0) = DRAG(J,2)+FMASK(J,1)*(DRAG(J,1)-DRAG(J,2)) |
113 |
c SHF(J,0) = SHF(J,2)+FMASK(J,1)*( SHF(J,1)- SHF(J,2)) |
114 |
c EVAP(J,0) = EVAP(J,2)+FMASK(J,1)*(EVAP(J,1)-EVAP(J,2)) |
115 |
c SLRU(J) = SLRup(J,2)+FMASK(J,1)*(SLRup(J,1)-SLRup(J,2)) |
116 |
DRAG(J,0) = (FMASK(J,1)*DRAG(J,1)+FMASK(J,2)*DRAG(J,2) |
117 |
& +FMASK(J,3)*DRAG(J,3)) |
118 |
SHF (J,0) = (FMASK(J,1)*SHF(J,1) +FMASK(J,2)*SHF(J,2) |
119 |
& +FMASK(J,3)*SHF(J,3) ) |
120 |
EVAP(J,0) = (FMASK(J,1)*EVAP(J,1)+FMASK(J,2)*EVAP(J,2) |
121 |
& +FMASK(J,3)*EVAP(J,3)) |
122 |
SLRU(J) = (FMASK(J,1)*SLRup(J,1)+FMASK(J,2)*SLRup(J,2) |
123 |
& +FMASK(J,3)*SLRup(J,3)) |
124 |
ENDDO |
125 |
|
126 |
DO J=1,NGP |
127 |
c TSFC(J) = TSEA(J)+FMASK(J,1)*(TLAND(J)-TSEA(J)) |
128 |
TSFC(J) = (FMASK(J,1)*TLAND(J) + FMASK(J,2)*TSEA(J) |
129 |
& + FMASK(J,3)*TSICE(J)) |
130 |
TSKIN(J) = TSFC(J)+FMASK(J,1)*dTskin(J) |
131 |
ENDDO |
132 |
|
133 |
C- Compute Net LW surf flux (+=upward) for each surface type: |
134 |
C (for diagnostic only) |
135 |
DO J=1,NGP |
136 |
SLRup(J,1)=EMISloc*SLRup(J,1)-SLRD(J) |
137 |
SLRup(J,2)=EMISloc*SLRup(J,2)-SLRD(J) |
138 |
SLRup(J,3)=EMISloc*SLRup(J,3)-SLRD(J) |
139 |
SLRU(J) =EMISloc*SLRU(J) |
140 |
ENDDO |
141 |
|
142 |
C- Check that Temp is OK for LW Radiation scheme : |
143 |
DO J=1,NGP |
144 |
IF ( TSFC(J).LT.lwTemp1 .OR. |
145 |
& TSFC(J).GT.lwTemp2 ) THEN |
146 |
i1 = 1 + mod((J-1),sNx) |
147 |
j1 = 1 + int((J-1)/sNx) |
148 |
WRITE(msgBuf,'(A,1PE20.13,A,2I4)') |
149 |
& 'SUFLUX_POST: TS=', TSFC(J), |
150 |
& ' out of range ',lwTemp1,lwTemp2 |
151 |
CALL PRINT_ERROR( msgBuf , myThid) |
152 |
WRITE(msgBuf,'(A,1P3E10.3,A,0P3F8.5)') |
153 |
& 'SUFLUX_POST: T_Lnd,Sea,Sic=',TLAND(J),TSEA(J),TSICE(J), |
154 |
& ' Mask:',FMASK(J,1),FMASK(J,2),FMASK(J,3) |
155 |
CALL PRINT_ERROR( msgBuf , myThid) |
156 |
WRITE(msgBuf,'(A,2I4,3I3,I6,2F9.3)') |
157 |
& 'SUFLUX_POST: Pb in i,j,bi,bj,myThid,IJ,X,Y=', |
158 |
& i1,j1,bi,bj,myThid,J,xC(i1,j1,bi,bj),yC(i1,j1,bi,bj) |
159 |
CALL PRINT_ERROR( msgBuf , myThid) |
160 |
STOP 'ABNORMAL END: S/R SUFLUX_POST' |
161 |
ENDIF |
162 |
ENDDO |
163 |
|
164 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
165 |
#endif /* ALLOW_AIM */ |
166 |
|
167 |
RETURN |
168 |
END |