/[MITgcm]/MITgcm/pkg/pp81/pp81_calc.F
ViewVC logotype

Contents of /MITgcm/pkg/pp81/pp81_calc.F

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


Revision 1.3 - (show annotations) (download)
Wed Apr 6 18:45:20 2005 UTC (19 years, 2 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58l_post, checkpoint57t_post, checkpoint57o_post, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint57s_post, checkpoint57k_post, checkpoint57g_post, checkpoint60, checkpoint61, checkpoint58r_post, checkpoint57i_post, checkpoint57y_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint58t_post, checkpoint58h_post, checkpoint57y_pre, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, 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, checkpoint58y_post, checkpoint58k_post, checkpoint58v_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint57j_post, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post
Changes since 1.2: +1 -4 lines
use baseTime as time origin ; DIFF_BASE_MULTIPLE replaces DIFFERENT_MULTIPLE

1 C $Header: /u/gcmpack/MITgcm/pkg/pp81/pp81_calc.F,v 1.2 2004/10/17 23:12:59 jmc Exp $
2 C $Name: $
3
4 #include "PP81_OPTIONS.h"
5
6 CBOP
7 C !ROUTINE: PP81_CALC
8
9 C !INTERFACE: =======================================================
10 subroutine PP81_CALC(
11 I bi, bj, myTime, myThid )
12
13 C !DESCRIPTION: \bv
14 C /==========================================================\
15 C | SUBROUTINE PP81_CALC |
16 C | o Compute all PP81 fields defined in PP81.h |
17 C |==========================================================|
18 C | This subroutine is based on SPEM code |
19 C \==========================================================/
20 IMPLICIT NONE
21 C
22 C--------------------------------------------------------------------
23
24 C global parameters updated by pp_calc
25 C PPviscAz - PP eddy viscosity coefficient (m^2/s)
26 C PPdiffKzT - PP diffusion coefficient for temperature (m^2/s)
27 C
28 C \ev
29
30 C !USES: ============================================================
31 #include "SIZE.h"
32 #include "EEPARAMS.h"
33 #include "PARAMS.h"
34 #include "DYNVARS.h"
35 #include "PP81.h"
36 #include "FFIELDS.h"
37 #include "GRID.h"
38 #ifdef ALLOW_AUTODIFF_TAMC
39 #include "tamc.h"
40 #include "tamc_keys.h"
41 #else /* ALLOW_AUTODIFF_TAMC */
42 integer ikppkey
43 #endif /* ALLOW_AUTODIFF_TAMC */
44
45 C !INPUT PARAMETERS: ===================================================
46 c Routine arguments
47 c bi, bj - array indices on which to apply calculations
48 c myTime - Current time in simulation
49
50 INTEGER bi, bj
51 INTEGER myThid
52 _RL myTime
53
54 #ifdef ALLOW_PP81
55
56 C !LOCAL VARIABLES: ====================================================
57 c Local constants
58 C imin, imax, jmin, jmax - array computation indices
59 C RiNumber - Richardson Number
60 INTEGER I, J, K
61 INTEGER iMin ,iMax ,jMin ,jMax
62 _RL denom, PPviscTmp
63 _RL RiNumber(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
64 CEOP
65 iMin = 2-OLx
66 iMax = sNx+OLx-1
67 jMin = 2-OLy
68 jMax = sNy+OLy-1
69
70 DO K = 2, Nr
71 CALL PP81_RI_NUMBER(
72 I bi, bj, K, iMin, iMax, jMin, jMax,
73 O RiNumber,
74 I myTime, myThid )
75 DO J=jMin,jMax
76 DO I=iMin,iMax
77 IF ( RiNumber(I,J) .LT. RiLimit ) THEN
78 denom = 1.0 + PPalpha*RiLimit
79 PPviscTmp = PPviscMax
80 ELSE
81 denom = 1.0 + PPalpha*RiNumber(I,J)
82 PPviscTmp = PPnu0/(denom**PPnRi)
83 ENDIF
84 C assign a minium ( = background ) value
85 PPviscAr(I,J,K,bi,bj) = MAX(PPviscTmp,viscAr)
86 PPdiffKr(I,J,K,bi,bj) = MAX(PPviscAr(I,J,K,bi,bj)/denom,
87 & diffKrNrT(k))
88 CML if ( k.eq.2 .and. i.ge.1 .and. i.le.sNx .and. j.eq.1)
89 CML & print '(A,3I3,5E14.5)', 'ml-pp81', I,J,K, RiLimit,
90 CML & RiNumber(I,J),denom,
91 CML & PPviscAr(I,J,K,bi,bj), PPdiffKr(I,J,K,bi,bj)
92 ENDDO
93 ENDDO
94 #ifdef ALLOW_PP81_LOWERBOUND
95 CRT This is where the lower limit for subsurface layers
96 CRT (BRIOS special) is set.
97 IF ( (buoyancyRelation .EQ. 'OCEANIC' .AND. K .EQ. 2) .OR.
98 & (buoyancyRelation .EQ. 'OCEANICP' .AND. K .EQ. Nr) ) THEN
99 DO J=jMin,jMax
100 DO I=iMin,iMax
101 PPviscAr(I,J,K,bi,bj) = MAX(PPviscMin,PPviscAr(I,J,K,bi,bj))
102 PPdiffKr(I,J,K,bi,bj) = MAX(PPdiffMin,PPdiffKr(I,J,K,bi,bj))
103 ENDDO
104 ENDDO
105 ENDIF
106 #endif /* ALLOW_PP81_LOWERBOUND */
107 C Mask land points
108 DO J=jMin,jMax
109 DO I=iMin,iMax
110 PPviscAr(I,J,K,bi,bj) = PPviscAr(I,J,K,bi,bj)
111 & * maskC(I,J,K,bi,bj)
112 PPdiffKr(I,J,K,bi,bj) = PPdiffKr(I,J,K,bi,bj)
113 & * maskC(I,J,K,bi,bj)
114 ENDDO
115 ENDDO
116 C end K-loop
117 ENDDO
118
119 #endif /* ALLOW_PP81 */
120
121 RETURN
122 END
123

  ViewVC Help
Powered by ViewVC 1.1.22