1 |
heimbach |
1.6 |
C $Header: /escher1/cvs/master/mitgcmuv/model/src/swfrac.F,v 1.6 2000/10/25 16:48:07 dimitri Exp $ |
2 |
adcroft |
1.1 |
|
3 |
|
|
#include "CPP_OPTIONS.h" |
4 |
|
|
|
5 |
|
|
SUBROUTINE SWFRAC( |
6 |
heimbach |
1.6 |
I imax, fact, |
7 |
|
|
I mytime, mythid, |
8 |
|
|
U swdk ) |
9 |
adcroft |
1.1 |
C /==========================================================\ |
10 |
|
|
C | SUBROUTINE SWFRAC | |
11 |
|
|
C | Compute fraction of solar short-wave flux penetrating to | |
12 |
heimbach |
1.6 |
C | specified depth, swdk, due to exponential decay in | |
13 |
adcroft |
1.1 |
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 |
heimbach |
1.6 |
C | Parameter jwtype is hardcoded to 3 for time being. | |
19 |
adcroft |
1.1 |
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 |
adcroft |
1.5 |
C imax number of vertical grid points |
32 |
|
|
C fact scale factor to apply to depth array |
33 |
heimbach |
1.6 |
C myTime current time in simulation |
34 |
|
|
C myThid thread number for this instance of the routine. |
35 |
adcroft |
1.5 |
|
36 |
|
|
INTEGER imax |
37 |
heimbach |
1.6 |
_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 |
adcroft |
1.5 |
|
47 |
|
|
C === Local variables === |
48 |
adcroft |
1.1 |
|
49 |
adcroft |
1.5 |
C max number of different water types |
50 |
heimbach |
1.6 |
integer nwtype , jwtype |
51 |
|
|
PARAMETER(nwtype=5) |
52 |
adcroft |
1.4 |
|
53 |
heimbach |
1.6 |
_RL facz |
54 |
adcroft |
1.5 |
_RL rfac(nwtype),a1(nwtype),a2(nwtype) |
55 |
adcroft |
1.1 |
INTEGER i |
56 |
heimbach |
1.6 |
|
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 |
adcroft |
1.1 |
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 |
heimbach |
1.6 |
#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=3 |
82 |
|
|
#endif /* ALLOW_CALENDAR */ |
83 |
|
|
|
84 |
adcroft |
1.1 |
DO i = 1,imax |
85 |
heimbach |
1.6 |
facz = fact*swdk(i) |
86 |
adcroft |
1.1 |
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 |
adcroft |
1.4 |
|
94 |
adcroft |
1.1 |
RETURN |
95 |
|
|
END |