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

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

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


Revision 1.4 - (hide annotations) (download)
Thu Jun 29 16:14:36 2006 UTC (17 years, 11 months ago) by dimitri
Branch: MAIN
CVS Tags: checkpoint58l_post, mitgcm_mapl_00, checkpoint58u_post, checkpoint58w_post, checkpoint60, checkpoint61, checkpoint58r_post, checkpoint58n_post, checkpoint58x_post, checkpoint58t_post, checkpoint58q_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint59, checkpoint58o_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, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58m_post
Changes since 1.3: +3 -1 lines
added missing #ifdef ALLOW_DIAGNOSTICS

1 dimitri 1.4 C $Header: /u/gcmpack/MITgcm/pkg/generic_advdiff/salt_fill.F,v 1.3 2006/06/05 20:23:13 molod Exp $
2 molod 1.1 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     . uVel, vVel,
12     . salt,
13     . flag,myTime,myIter,myThid)
14     C
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     C
29     C !INPUT PARAMETERS: ===================================================
30     C uVel :: zonal velocity component
31     C vVel :: meridional velocity component
32     C salt :: salt field
33     C flag :: integer flag telling scheme how to fill
34     C myTime :: current time
35     C myIter :: iteration number
36     C myThid :: thread number
37     C !OUTPUT PARAMETERS: ==================================================
38     C salt :: salt array is replaced
39     CEOP
40     C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
41     IMPLICIT NONE
42     #include "SIZE.h"
43     #include "EEPARAMS.h"
44     #include "PARAMS.h"
45     #include "GRID.h"
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    
54 dimitri 1.4 #ifdef ALLOW_DIAGNOSTICS
55 molod 1.1 logical diagnostics_is_on
56     external diagnostics_is_on
57 dimitri 1.4 #endif
58 molod 1.1
59     INTEGER bi,bj,i,j,L,LM1
60 molod 1.3 _RL dpratio, scale
61 molod 1.1
62     DO bj=myByLo(myThid),myByHi(myThid)
63     DO bi=myBxLo(myThid),myBxHi(myThid)
64     C Fill diagnostic for filling with negative of salt
65     #ifdef ALLOW_DIAGNOSTICS
66     IF (useDiagnostics)THEN
67 molod 1.2 if(diagnostics_is_on('SALTFILL',myThid) ) then
68 molod 1.3 scale = -1. _d 0
69     CALL DIAGNOSTICS_SCALE_FILL(salt,scale,1,'SALTFILL',
70     . 0,Nr,-1,bi,bj,myThid)
71 molod 1.1 endif
72     ENDIF
73     #endif
74    
75     c Flag = 1:
76     c ---------------------------------
77     if(flag.eq.1) then
78    
79     do L=Nr,2,-1
80     LM1 = L-1
81     dpratio= rC(L)/rC(LM1)
82 molod 1.2 do j=1,sNy
83     do i=1,sNx
84 molod 1.1 if( salt(i,j,L,bi,bj).lt.0.0 _d 0) then
85     salt(i,j,LM1,bi,bj) = salt(i,j,LM1,bi,bj) +
86     . salt(i,j,L,bi,bj)*dpratio
87     salt(i,j,L,bi,bj) = 0.0 _d 0
88     endif
89     enddo
90     enddo
91     enddo
92    
93 molod 1.2 do j=1,sNy
94     do i=1,sNx
95 molod 1.1 if(salt(i,j,1,bi,bj).lt.0.0 _d 0)
96     . salt(i,j,1,bi,bj) = 0.0 _d 0
97     enddo
98     enddo
99    
100     else
101     print *,'Invalid Flag in salt_fill - nothing done '
102     endif
103    
104     C Fill diagnostic for filling with salt - get tendency
105     #ifdef ALLOW_DIAGNOSTICS
106     IF (useDiagnostics)THEN
107 molod 1.2 if(diagnostics_is_on('SALTFILL',myThid) ) then
108 molod 1.1 CALL DIAGNOSTICS_FILL(salt,'SALTFILL',0,Nr,1,bi,bj,myThid)
109     endif
110     ENDIF
111     #endif
112     ENDDO
113     ENDDO
114    
115     RETURN
116     END

  ViewVC Help
Powered by ViewVC 1.1.22