1 |
C /u/gcmpack/models/MITgcmUV/model/src/ini_forcing.F,v 1.15 1998/12/15 00:20:34 adcroft Exp |
C $Header$ |
2 |
|
|
3 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
4 |
|
|
|
C I.Fukumori 8/24/98 |
|
|
CStartOfInterface |
|
5 |
SUBROUTINE SWFRAC( |
SUBROUTINE SWFRAC( |
6 |
I imax, fact, z, jwtype, |
I imax, fact, |
7 |
O swdk ) |
I mytime, mythid, |
8 |
|
U swdk ) |
9 |
C /==========================================================\ |
C /==========================================================\ |
10 |
C | SUBROUTINE SWFRAC | |
C | SUBROUTINE SWFRAC | |
11 |
C | Compute fraction of solar short-wave flux penetrating to | |
C | Compute fraction of solar short-wave flux penetrating to | |
12 |
C | specified depth, z, due to exponential decay in | |
C | specified depth, swdk, due to exponential decay in | |
13 |
C | Jerlov water type jwtype. | |
C | Jerlov water type jwtype. | |
14 |
C | Reference : Two band solar absorption model of Paulson | |
C | Reference : Two band solar absorption model of Paulson | |
15 |
C | and Simpson (1977, JPO, 7, 952-956) | |
C | and Simpson (1977, JPO, 7, 952-956) | |
16 |
C | Notes | |
C | Notes | |
17 |
C | ===== | |
C | ===== | |
18 |
|
C | Parameter jwtype is hardcoded to 3 for time being. | |
19 |
C | Below 200m the solar penetration gets set to zero, | |
C | Below 200m the solar penetration gets set to zero, | |
20 |
C | otherwise the limit for the exponent (+/- 5678) needs to | |
C | otherwise the limit for the exponent (+/- 5678) needs to | |
21 |
C | be taken care of. | |
C | be taken care of. | |
25 |
|
|
26 |
IMPLICIT NONE |
IMPLICIT NONE |
27 |
|
|
|
integer nwtype |
|
|
PARAMETER(nwtype=5) ! max number of different water types |
|
|
|
|
28 |
C === Routine arguments === |
C === Routine arguments === |
29 |
|
|
30 |
C input arguments |
C input arguments |
31 |
INTEGER imax ! number of vertical grid points |
C imax number of vertical grid points |
32 |
_RS fact ! scale factor to apply to depth array |
C fact scale factor to apply to depth array |
33 |
_RS z(imax) ! vertical depth for desired sw fraction |
C myTime current time in simulation |
34 |
! (fact*z) is negative distance (m) from surface |
C myThid thread number for this instance of the routine. |
35 |
INTEGER jwtype ! index for jerlov water type |
|
36 |
|
INTEGER imax |
37 |
C output arguments |
_RL fact |
38 |
_RS swdk(imax) ! short wave (radiation) fractional decay |
_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 === |
C === Local variables === |
48 |
_RS facz |
|
49 |
REAL rfac(nwtype),a1(nwtype),a2(nwtype) |
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 |
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 |
C |
67 |
C Jerlov water type : I IA IB II III |
C Jerlov water type : I IA IB II III |
68 |
C jwtype 1 2 3 4 5 |
C jwtype 1 2 3 4 5 |
71 |
DATA a1 / 0.35 , 0.6 , 1.0 , 1.5 , 1.4 / |
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 / |
DATA a2 / 23.0 , 20.0 , 17.0 , 14.0 , 7.9 / |
73 |
C |
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 |
DO i = 1,imax |
85 |
facz = fact*z(i) |
facz = fact*swdk(i) |
86 |
IF (facz .LT. (-200.)) THEN |
IF (facz .LT. (-200.)) THEN |
87 |
swdk(i) = 0. |
swdk(i) = 0. |
88 |
ELSE |
ELSE |