1 |
dimitri |
1.1 |
C $Header: /u/gcmpack/MITgcm/model/src/plumefrac.F,v 1.00 2007/09/13 16:41:00 atn Exp $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
#include "PACKAGES_CONFIG.h" |
5 |
|
|
#include "CPP_OPTIONS.h" |
6 |
|
|
|
7 |
|
|
CBOP |
8 |
|
|
C !ROUTINE: PLUMEFRAC |
9 |
|
|
C !INTERFACE: |
10 |
|
|
SUBROUTINE PLUMEFRAC( |
11 |
|
|
I imax, fact,SPDepth, |
12 |
|
|
U plumek, |
13 |
|
|
I myTime, myIter, myThid ) |
14 |
|
|
C !DESCRIPTION: \bv |
15 |
|
|
C *==========================================================* |
16 |
|
|
C | SUBROUTINE PLUMEFRAC |
17 |
|
|
C | o Compute saltplume penetration. |
18 |
|
|
C *==========================================================* |
19 |
|
|
C | Compute fraction of saltplume (flux) penetrating to |
20 |
|
|
C | specified depth, plumek, due to rejected salt |
21 |
|
|
C | during freezing. |
22 |
|
|
C | For example, if surface value is Saltplume0, |
23 |
|
|
C | and each level gets equal fraction 1/5 down to SPDepth=5, |
24 |
|
|
C | PLUMEFRAC will report plumek = 4/5 on output if the input |
25 |
|
|
C | plumek = 1. Else, output plumek = 0. |
26 |
|
|
C | Reference : Duffy et al, (GRL 1999) |
27 |
|
|
C | |
28 |
|
|
C | |
29 |
|
|
C | ===== |
30 |
|
|
C | Written by : ATN (based on SWFRAC) |
31 |
|
|
C | Date : Sep 13, 2007 |
32 |
|
|
C *==========================================================* |
33 |
|
|
C \ev |
34 |
|
|
|
35 |
|
|
C !USES: |
36 |
|
|
IMPLICIT NONE |
37 |
|
|
|
38 |
|
|
C !INPUT/OUTPUT PARAMETERS: |
39 |
|
|
C === Routine arguments === |
40 |
|
|
C input arguments |
41 |
|
|
C imax :: number of vertical grid points |
42 |
|
|
C fact :: scale factor to apply to depth array |
43 |
|
|
C SPDpeth :: corresponding SaltPlumeDepth(i,j) at this grid point |
44 |
|
|
C myTime :: Current time in simulation |
45 |
|
|
C myIter :: Current iteration number in simulation |
46 |
|
|
C myThid :: My Thread Id. number |
47 |
|
|
INTEGER imax |
48 |
|
|
_RL fact |
49 |
|
|
_RL myTime |
50 |
|
|
INTEGER myIter |
51 |
|
|
INTEGER myThid |
52 |
|
|
C input/output arguments |
53 |
|
|
C plumek :: on input: vertical depth for desired plume fraction |
54 |
|
|
C (fact*plumek) is negative distance (m) from surface |
55 |
|
|
C plumek :: on output: saltplume contribution fraction |
56 |
|
|
_RL plumek(imax), SPDepth(imax) |
57 |
|
|
|
58 |
|
|
C !LOCAL VARIABLES: |
59 |
|
|
C === Local variables === |
60 |
|
|
_RL facz |
61 |
|
|
INTEGER i |
62 |
|
|
_RL tinee |
63 |
|
|
parameter( tinee = 1.e-1) |
64 |
|
|
#ifdef ALLOW_CAL |
65 |
|
|
LOGICAL first, changed |
66 |
|
|
INTEGER count0, count1 |
67 |
|
|
#endif /* ALLOW_CAL */ |
68 |
|
|
CEOP |
69 |
|
|
|
70 |
|
|
#ifdef ALLOW_CAL |
71 |
|
|
ceh3 this should have an IF ( useCALENDAR ) THEN |
72 |
|
|
CML( |
73 |
|
|
C myIter = 0 makes cal_getMonthsRec always return count0=12 |
74 |
|
|
C so that jerl(count0) = 2. |
75 |
|
|
C The following lines are meant to be an example of how to |
76 |
|
|
C include time dependent water types. However, it would probably |
77 |
|
|
C make more sense to first think about a regionally varying |
78 |
|
|
C water type before implementing a time dependence. |
79 |
|
|
CML CALL cal_GetMonthsRec( |
80 |
|
|
CML O fac, first, changed, count0, count1, |
81 |
|
|
CML I myTime, myIter, myThid ) |
82 |
|
|
CML jwtype=jerl(count0) |
83 |
|
|
CML) |
84 |
|
|
#else /* ALLOW_CAL undef */ |
85 |
|
|
#endif /* ALLOW_CAL */ |
86 |
|
|
|
87 |
|
|
DO i = 1,imax |
88 |
|
|
facz = abs(fact*plumek(i)) |
89 |
|
|
IF (SPDepth(i).GT.facz .AND. SPDepth(i).GT.tinee) THEN |
90 |
|
|
!plumek(i) = min(plumedk(i),SPDepth(i)+facz)/SPDepth(i) |
91 |
|
|
plumek(i) = 1.0 - min(1.0,facz/abs(SPDepth(i))) |
92 |
|
|
ELSE |
93 |
|
|
plumek(i) = 0. |
94 |
|
|
ENDIF |
95 |
|
|
ENDDO |
96 |
|
|
|
97 |
|
|
RETURN |
98 |
|
|
END |