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