1 |
C $Header: /u/gcmpack/MITgcm/pkg/dic/alk_surfforcing.F,v 1.12 2008/04/07 20:31:16 dfer Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "DIC_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: ALK_SURFFORCING |
8 |
|
9 |
C !INTERFACE: ========================================================== |
10 |
SUBROUTINE ALK_SURFFORCING( PTR_ALK , GALK, |
11 |
I bi,bj,imin,imax,jmin,jmax, |
12 |
I myIter,myTime,myThid) |
13 |
|
14 |
C !DESCRIPTION: |
15 |
C Calculate the alkalinity change due to freshwater flux |
16 |
C Update alkalinity tendency term |
17 |
|
18 |
C !USES: =============================================================== |
19 |
IMPLICIT NONE |
20 |
#include "SIZE.h" |
21 |
#include "DYNVARS.h" |
22 |
#include "EEPARAMS.h" |
23 |
#include "PARAMS.h" |
24 |
#include "GRID.h" |
25 |
#include "FFIELDS.h" |
26 |
#include "DIC_VARS.h" |
27 |
|
28 |
C !INPUT PARAMETERS: =================================================== |
29 |
C myThid :: thread number |
30 |
C myIter :: current timestep |
31 |
C myTime :: current time |
32 |
C bi,bj :: tile indices |
33 |
C PTR_ALK :: alkalinity field |
34 |
INTEGER myIter, myThid |
35 |
_RL myTime |
36 |
_RL PTR_ALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr) |
37 |
INTEGER iMin,iMax,jMin,jMax, bi, bj |
38 |
|
39 |
C !OUTPUT PARAMETERS: ================================================== |
40 |
C GALK :: tendency term of alkalinity |
41 |
_RL GALK(1-OLx:sNx+OLx,1-OLy:sNy+OLy) |
42 |
|
43 |
#ifdef ALLOW_PTRACERS |
44 |
#ifdef DIC_BIOTIC |
45 |
|
46 |
#ifdef ALLOW_OLD_VIRTUALFLUX |
47 |
C !LOCAL VARIABLES: ==================================================== |
48 |
C i,j :: loop indices |
49 |
INTEGER i,j |
50 |
CEOP |
51 |
|
52 |
DO j=jmin,jmax |
53 |
DO i=imin,imax |
54 |
IF (maskC(i,j,1,bi,bj).NE.0. _d 0) THEN |
55 |
c calculate virtual flux |
56 |
c EminusPforV = dS/dt*(1/Sglob) |
57 |
C NOTE: Be very careful with signs here! |
58 |
C Positive EminusPforV => loss of water to atmos and increase |
59 |
C in salinity. Thus, also increase in other surface tracers |
60 |
C (i.e. positive virtual flux into surface layer) |
61 |
GALK(i,j)=gsm_ALK*surfaceForcingS(i,j,bi,bj)* |
62 |
& recip_drF(1)/gsm_S |
63 |
c OR |
64 |
c let virtual flux be zero |
65 |
c GALK(i,j)=0.d0 |
66 |
c |
67 |
ELSE |
68 |
GALK(i,j)=0. _d 0 |
69 |
ENDIF |
70 |
ENDDO |
71 |
ENDDO |
72 |
#endif /* ALLOW_OLD_VIRTUALFLUX */ |
73 |
|
74 |
#endif |
75 |
#endif |
76 |
RETURN |
77 |
END |