/[MITgcm]/MITgcm/pkg/timeave/timeave_surf_flux.F
ViewVC logotype

Contents of /MITgcm/pkg/timeave/timeave_surf_flux.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Tue Oct 19 02:41:31 2004 UTC (19 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57d_post, checkpoint57g_post, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint55h_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint58t_post, checkpoint58h_post, checkpoint56c_post, checkpoint57y_pre, checkpoint57f_pre, checkpoint57a_post, checkpoint58q_post, checkpoint57v_post, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint57n_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint57c_post, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint58p_post, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post
Changes since 1.2: +4 -4 lines
use flags: fluidIsAir/Water, usingP/ZCoords instead of buoyancyRelation

1 C $Header: /u/gcmpack/MITgcm/pkg/timeave/timeave_surf_flux.F,v 1.2 2004/07/18 01:16:36 jmc Exp $
2 C $Name: $
3 #include "TIMEAVE_OPTIONS.h"
4
5 SUBROUTINE TIMEAVE_SURF_FLUX(
6 I bi, bj, myTime, myIter, myThid)
7 C *==========================================================*
8 C | SUBROUTINE TIMEAVE_SURF_FLUX |
9 C | o Time averaging routine for surface (forcing) fluxes |
10 C *==========================================================*
11 IMPLICIT NONE
12
13 C == Global variables ===
14 #include "SIZE.h"
15 #include "EEPARAMS.h"
16 #include "PARAMS.h"
17 #include "GRID.h"
18 #include "DYNVARS.h"
19 #include "SURFACE.h"
20 #include "FFIELDS.h"
21 #include "TIMEAVE_STATV.h"
22
23 C == Routine arguments ==
24 C bi, bj :: current tile indices
25 C myTime :: Current time of simulation ( s )
26 C myIter :: Iteration number
27 C myThid :: Thread number for this instance of the routine.
28 INTEGER bi, bj
29 _RL myTime
30 INTEGER myIter
31 INTEGER myThid
32
33 #ifdef ALLOW_TIMEAVE
34
35 C == Local variables ==
36 INTEGER I, J, K
37 _RL DDTT
38 _RL tmpFld (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
39
40 C- Time Averages of surface fluxes
41 IF ( usingPCoords ) THEN
42 k=Nr
43 ELSE
44 k=1
45 ENDIF
46
47 C- uFlux (surface momentum flux [Pa=N/m2], positive <-> increase u)
48 c DO j=1,sNy
49 c DO i=1,sNx
50 c tmpFld(i,j)=fu(i,j,bi,bj)*foFacMom*_maskW(i,j,k,bi,bj)
51 c ENDDO
52 c ENDDO
53 c CALL TIMEAVE_CUMUL_1T(uFluxtave,tmpFld,1,
54 c & deltaTclock, bi, bj, myThid)
55 DDTT = deltaTclock*foFacMom
56 CALL TIMEAVE_CUMULATE( uFluxtave, fu, 1,
57 & DDTT, bi, bj, myThid)
58
59 C- vFlux (surface momentum flux [Pa=N/m2], positive <-> increase v)
60 c DO j=1,sNy
61 c DO i=1,sNx
62 c tmpFld(i,j)=fv(i,j,bi,bj)*foFacMom*_maskS(i,j,k,bi,bj)
63 c ENDDO
64 c ENDDO
65 c CALL TIMEAVE_CUMUL_1T(vFluxtave,tmpFld,1,
66 c & deltaTclock, bi, bj, myThid)
67 DDTT = deltaTclock*foFacMom
68 CALL TIMEAVE_CUMULATE( vFluxtave, fv, 1,
69 & DDTT, bi, bj, myThid)
70
71 C tFlux (=Heat flux [W/m2], positive <-> increasing Theta)
72 DO j=1,sNy
73 DO i=1,sNx
74 tmpFld(i,j) =
75 #ifdef SHORTWAVE_HEATING
76 & -Qsw(i,j,bi,bj)+
77 #endif
78 & (surfaceForcingT(i,j,bi,bj)+surfaceForcingTice(I,J,bi,bj))
79 & *HeatCapacity_Cp*recip_horiVertRatio*rhoConst
80 ENDDO
81 ENDDO
82 #ifdef NONLIN_FRSURF
83 IF ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
84 & .AND. useRealFreshWaterFlux ) THEN
85 DO j=1,sNy
86 DO i=1,sNx
87 tmpFld(i,j) = tmpFld(i,j)
88 & + PmEpR(i,j,bi,bj)*rhoConstFresh
89 & *theta(i,j,k,bi,bj)*HeatCapacity_Cp
90 ENDDO
91 ENDDO
92 ENDIF
93 #endif /* NONLIN_FRSURF */
94 CALL TIMEAVE_CUMUL_1T( tFluxtave, tmpFld, 1,
95 & deltaTclock, bi, bj, myThid)
96
97 C sFlux (=salt flux [psu.kg/m2/s], positive <-> increasing Theta)
98 DO j=1,sNy
99 DO i=1,sNx
100 tmpFld(i,j)=
101 & surfaceForcingS(i,j,bi,bj)*
102 & recip_horiVertRatio*rhoConst
103 ENDDO
104 ENDDO
105 #ifdef NONLIN_FRSURF
106 IF ( (nonlinFreeSurf.GT.0 .OR. usingPCoords)
107 & .AND. useRealFreshWaterFlux ) THEN
108 DO j=1,sNy
109 DO i=1,sNx
110 tmpFld(i,j) = tmpFld(i,j)
111 & + PmEpR(i,j,bi,bj)*rhoConstFresh
112 & *salt(i,j,k,bi,bj)
113 ENDDO
114 ENDDO
115 ENDIF
116 #endif /* NONLIN_FRSURF */
117 CALL TIMEAVE_CUMUL_1T( sFluxtave, tmpFld, 1,
118 & deltaTclock, bi, bj, myThid)
119
120 #endif /* ALLOW_TIMEAVE */
121
122 RETURN
123 END

  ViewVC Help
Powered by ViewVC 1.1.22