1 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/swfrac.F,v 1.8 2001/02/04 14:38:48 cnh Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_OPTIONS.h" |
5 |
|
6 |
CBOP |
7 |
C !ROUTINE: SWFRAC |
8 |
C !INTERFACE: |
9 |
SUBROUTINE SWFRAC( |
10 |
I imax, fact, |
11 |
I mytime, mythid, |
12 |
U swdk ) |
13 |
C !DESCRIPTION: \bv |
14 |
C *==========================================================* |
15 |
C | SUBROUTINE SWFRAC |
16 |
C | o Compute solar short-wave flux penetration. |
17 |
C *==========================================================* |
18 |
C | Compute fraction of solar short-wave flux penetrating to |
19 |
C | specified depth, swdk, due to exponential decay in |
20 |
C | Jerlov water type jwtype. |
21 |
C | Reference : Two band solar absorption model of Paulson |
22 |
C | and Simpson (1977, JPO, 7, 952-956) |
23 |
C | Notes |
24 |
C | ===== |
25 |
C | Parameter jwtype is hardcoded to 3 for time being. |
26 |
C | Below 200m the solar penetration gets set to zero, |
27 |
C | otherwise the limit for the exponent (+/- 5678) needs to |
28 |
C | be taken care of. |
29 |
C | Written by : Jan Morzel |
30 |
C | Date : July 12, 1995 |
31 |
C *==========================================================* |
32 |
C \ev |
33 |
|
34 |
C !USES: |
35 |
IMPLICIT NONE |
36 |
|
37 |
C !INPUT/OUTPUT PARAMETERS: |
38 |
C === Routine arguments === |
39 |
C input arguments |
40 |
C imax :: number of vertical grid points |
41 |
C fact :: scale factor to apply to depth array |
42 |
C myTime :: current time in simulation |
43 |
C myThid :: thread number for this instance of the routine. |
44 |
INTEGER imax |
45 |
_RL fact |
46 |
_RL mytime |
47 |
integer mythid |
48 |
C input/output arguments |
49 |
C swdk :: on input: vertical depth for desired sw fraction |
50 |
C (fact*swdk) is negative distance (m) from surface |
51 |
C swdk :: on output: short wave (radiation) fractional decay |
52 |
_RL swdk(imax) |
53 |
|
54 |
C !LOCAL VARIABLES: |
55 |
C === Local variables === |
56 |
C max number of different water types |
57 |
integer nwtype , jwtype |
58 |
PARAMETER(nwtype=5) |
59 |
_RL facz |
60 |
_RL rfac(nwtype),a1(nwtype),a2(nwtype) |
61 |
INTEGER i |
62 |
#ifdef ALLOW_CALENDAR |
63 |
_RL fac |
64 |
logical first, changed |
65 |
integer count0, count1 |
66 |
integer myiter |
67 |
integer jerl(12) |
68 |
data jerl / 2 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 3 , 2 / |
69 |
#endif /* ALLOW_CALENDAR */ |
70 |
C |
71 |
C Jerlov water type : I IA IB II III |
72 |
C jwtype 1 2 3 4 5 |
73 |
C |
74 |
DATA rfac / 0.58 , 0.62 , 0.67 , 0.77 , 0.78 / |
75 |
DATA a1 / 0.35 , 0.6 , 1.0 , 1.5 , 1.4 / |
76 |
DATA a2 / 23.0 , 20.0 , 17.0 , 14.0 , 7.9 / |
77 |
CEOP |
78 |
|
79 |
#ifdef ALLOW_CALENDAR |
80 |
myiter=0 |
81 |
call cal_GetMonthsRec( |
82 |
O fac, first, changed, count0, count1, |
83 |
I mytime, myiter, mythid ) |
84 |
jwtype=jerl(count0) |
85 |
#else /* ALLOW_CALENDAR undef */ |
86 |
jwtype=2 |
87 |
#endif /* ALLOW_CALENDAR */ |
88 |
|
89 |
DO i = 1,imax |
90 |
facz = fact*swdk(i) |
91 |
IF (facz .LT. (-200.)) THEN |
92 |
swdk(i) = 0. |
93 |
ELSE |
94 |
swdk(i) = rfac(jwtype) * exp(facz/a1(jwtype)) |
95 |
$ + (1.-rfac(jwtype)) * exp(facz/a2(jwtype)) |
96 |
ENDIF |
97 |
ENDDO |
98 |
|
99 |
RETURN |
100 |
END |