/[MITgcm]/MITgcm/pkg/generic_advdiff/salt_fill.F
ViewVC logotype

Contents of /MITgcm/pkg/generic_advdiff/salt_fill.F

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


Revision 1.5 - (show annotations) (download)
Tue Dec 8 21:41:01 2009 UTC (14 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, HEAD
Changes since 1.4: +41 -37 lines
remove un-used var (+ little cleaning)

1 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/salt_fill.F,v 1.4 2006/06/29 16:14:36 dimitri Exp $
2 C $Name: $
3
4 #include "GAD_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 CBOP
8 C !ROUTINE: SALT_FILL
9 C !INTERFACE: ==========================================================
10 SUBROUTINE SALT_FILL(
11 I uVel, vVel,
12 U salt,
13 I flag,myTime,myIter,myThid)
14
15 C !DESCRIPTION:
16 C Fills in negatives for the salt (specific humidity) field
17 C
18 C The algorithm is as follows:
19 C
20 C Simplest scheme (flag = 1) -> borrow from below and create
21 C salt if needed at bottom level
22 C 'Get it back' (flag = 2) -> Fill negative of salt by getting it
23 C back from where it went
24 C If no immediate surrounding value is large enough to fill negative,
25 C the sum of immediate surrounding positive values is tried.
26 C If sum is not large enough, salt is simply set to zero.
27 C NOTE AS OF 6/2/06 -- DO NOT USE FLAG=2 OPTION - NOT WORKING
28
29 C !USES:
30 IMPLICIT NONE
31 #include "SIZE.h"
32 #include "EEPARAMS.h"
33 #include "PARAMS.h"
34 #include "GRID.h"
35
36 C !INPUT PARAMETERS: ===================================================
37 C uVel :: zonal velocity component
38 C vVel :: meridional velocity component
39 C salt :: salt field
40 C flag :: integer flag telling scheme how to fill
41 C myTime :: current time
42 C myIter :: iteration number
43 C myThid :: thread number
44 C !OUTPUT PARAMETERS: ==================================================
45 C salt :: salt array is replaced
46 _RL uVel (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
47 _RL vVel (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
48 _RL salt (1-Olx:sNx+Olx,1-Oly:sNy+Oly,Nr,nSx,nSy)
49 INTEGER flag
50 _RL myTime
51 INTEGER myIter
52 INTEGER myThid
53 CEOP
54
55 C !FUNCTIONS:
56 c#ifdef ALLOW_DIAGNOSTICS
57 c LOGICAL DIAGNOSTICS_IS_ON
58 c EXTERNAL DIAGNOSTICS_IS_ON
59 c#endif
60
61 C !LOCAL VARIABLES:
62 INTEGER bi,bj,i,j,L,LM1
63 _RL dpratio
64 #ifdef ALLOW_DIAGNOSTICS
65 _RL tmpFac
66 #endif
67
68 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
69
70 DO bj=myByLo(myThid),myByHi(myThid)
71 DO bi=myBxLo(myThid),myBxHi(myThid)
72 #ifdef ALLOW_DIAGNOSTICS
73 C Fill diagnostic for filling with negative of salt
74 IF (useDiagnostics)THEN
75 tmpFac = -1. _d 0
76 CALL DIAGNOSTICS_SCALE_FILL(salt,tmpFac,1,'SALTFILL',
77 & 0,Nr,-1,bi,bj,myThid)
78 ENDIF
79 #endif
80
81 c Flag = 1:
82 c ---------------------------------
83 if(flag.eq.1) then
84
85 do L=Nr,2,-1
86 LM1 = L-1
87 dpratio= rC(L)/rC(LM1)
88 do j=1,sNy
89 do i=1,sNx
90 if( salt(i,j,L,bi,bj).lt.0.0 _d 0) then
91 salt(i,j,LM1,bi,bj) = salt(i,j,LM1,bi,bj) +
92 . salt(i,j,L,bi,bj)*dpratio
93 salt(i,j,L,bi,bj) = 0.0 _d 0
94 endif
95 enddo
96 enddo
97 enddo
98
99 do j=1,sNy
100 do i=1,sNx
101 if(salt(i,j,1,bi,bj).lt.0.0 _d 0)
102 . salt(i,j,1,bi,bj) = 0.0 _d 0
103 enddo
104 enddo
105
106 else
107 print *,'Invalid Flag in salt_fill - nothing done '
108 endif
109
110 #ifdef ALLOW_DIAGNOSTICS
111 C Fill diagnostic for filling with salt - get tendency
112 IF ( useDiagnostics ) THEN
113 CALL DIAGNOSTICS_FILL(salt,'SALTFILL',0,Nr,1,bi,bj,myThid)
114 ENDIF
115 #endif
116 ENDDO
117 ENDDO
118
119 RETURN
120 END

  ViewVC Help
Powered by ViewVC 1.1.22