1 |
C $Header: /u/gcmpack/MITgcm/pkg/frazil/frazil_tendency_apply.F,v 1.4 2014/05/06 15:50:14 jmc Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "FRAZIL_OPTIONS.h" |
5 |
C-- File frazil_tendency_apply.F: Routines to apply FRAZIL tendencies |
6 |
C-- Contents |
7 |
C-- o FRAZIL_TENDENCY_APPLY_T |
8 |
|
9 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
10 |
CBOP 0 |
11 |
|
12 |
C !INTERFACE: |
13 |
SUBROUTINE FRAZIL_TENDENCY_APPLY_T( |
14 |
U gT_arr, |
15 |
I iMin,iMax,jMin,jMax, k, bi, bj, |
16 |
I myTime, myIter, myThid ) |
17 |
|
18 |
C !DESCRIPTION: |
19 |
C Add frazil tendency terms to T (theta) tendency. |
20 |
C Routine works for one level at a time. |
21 |
|
22 |
C !USES: |
23 |
IMPLICIT NONE |
24 |
#include "SIZE.h" |
25 |
#include "EEPARAMS.h" |
26 |
#include "PARAMS.h" |
27 |
#include "GRID.h" |
28 |
c#include "DYNVARS.h" |
29 |
#ifdef ALLOW_FRAZIL |
30 |
# include "FRAZIL.h" |
31 |
#endif |
32 |
|
33 |
C !INPUT/OUTPUT PARAMETERS: |
34 |
C gT_arr :: the tendency array |
35 |
C iMin,iMax :: Working range of x-index for applying forcing. |
36 |
C jMin,jMax :: Working range of y-index for applying forcing. |
37 |
C k :: Current vertical level index |
38 |
C bi,bj :: Current tile indices |
39 |
C myTime :: Current time in simulation |
40 |
C myIter :: Current iteration number |
41 |
C myThid :: my Thread Id number |
42 |
_RL gT_arr(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
43 |
INTEGER iMin, iMax, jMin, jMax |
44 |
INTEGER k, bi, bj |
45 |
_RL myTime |
46 |
INTEGER myIter |
47 |
INTEGER myThid |
48 |
CEOP |
49 |
|
50 |
#ifdef ALLOW_FRAZIL |
51 |
|
52 |
C !LOCAL VARIABLES: |
53 |
INTEGER i, j |
54 |
_RL recip_Cp |
55 |
|
56 |
recip_Cp = 1. _d 0 / HeatCapacity_Cp |
57 |
DO j=jMin,jMax |
58 |
DO i=iMin,iMax |
59 |
gT_arr(i,j) = gT_arr(i,j) |
60 |
& + FrazilForcingT(i,j,k,bi,bj) |
61 |
& * recip_Cp * mass2rUnit |
62 |
& * recip_drF(k) * _recip_hFacC(i,j,k,bi,bj) |
63 |
ENDDO |
64 |
ENDDO |
65 |
|
66 |
#endif /* ALLOW_FRAZIL */ |
67 |
|
68 |
RETURN |
69 |
END |