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 |
|
C $Name$ |
3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
6 |
#ifdef ALLOW_KPP |
CBOP |
7 |
C I.Fukumori 8/24/98 |
C !ROUTINE: SWFRAC |
8 |
CStartOfInterface |
C !INTERFACE: |
9 |
SUBROUTINE SWFRAC( |
SUBROUTINE SWFRAC( |
10 |
I imax, fact, z, jwtype, |
I imax, fact, |
11 |
O swdk ) |
I mytime, mythid, |
12 |
C /==========================================================\ |
U swdk ) |
13 |
C | SUBROUTINE SWFRAC | |
C !DESCRIPTION: \bv |
14 |
C | Compute fraction of solar short-wave flux penetrating to | |
C *==========================================================* |
15 |
C | specified depth, z, due to exponential decay in | |
C | SUBROUTINE SWFRAC |
16 |
C | Jerlov water type jwtype. | |
C | o Compute solar short-wave flux penetration. |
17 |
C | Reference : Two band solar absorption model of Paulson | |
C *==========================================================* |
18 |
C | and Simpson (1977, JPO, 7, 952-956) | |
C | Compute fraction of solar short-wave flux penetrating to |
19 |
C | Notes | |
C | specified depth, swdk, due to exponential decay in |
20 |
C | ===== | |
C | Jerlov water type jwtype. |
21 |
C | Below 200m the solar penetration gets set to zero, | |
C | Reference : Two band solar absorption model of Paulson |
22 |
C | otherwise the limit for the exponent (+/- 5678) needs to | |
C | and Simpson (1977, JPO, 7, 952-956) |
23 |
C | be taken care of. | |
C | Notes |
24 |
C | Written by : Jan Morzel | |
C | ===== |
25 |
C | Date : July 12, 1995 | |
C | Parameter jwtype is hardcoded to 3 for time being. |
26 |
C \==========================================================/ |
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 |
IMPLICIT NONE |
36 |
|
|
37 |
integer nwtype |
C !INPUT/OUTPUT PARAMETERS: |
|
PARAMETER(nwtype=5) ! max number of different water types |
|
|
|
|
38 |
C === Routine arguments === |
C === Routine arguments === |
|
|
|
39 |
C input arguments |
C input arguments |
40 |
INTEGER imax ! number of vertical grid points |
C imax :: number of vertical grid points |
41 |
_RS fact ! scale factor to apply to depth array |
C fact :: scale factor to apply to depth array |
42 |
_RS z(imax) ! vertical depth for desired sw fraction |
C myTime :: current time in simulation |
43 |
! (fact*z) is negative distance (m) from surface |
C myThid :: thread number for this instance of the routine. |
44 |
INTEGER jwtype ! index for jerlov water type |
INTEGER imax |
45 |
|
_RL fact |
46 |
C output arguments |
_RL mytime |
47 |
_RS swdk(imax) ! short wave (radiation) fractional decay |
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 === |
C === Local variables === |
56 |
_RS facz |
C max number of different water types |
57 |
REAL rfac(nwtype),a1(nwtype),a2(nwtype) |
integer nwtype , jwtype |
58 |
|
PARAMETER(nwtype=5) |
59 |
|
_RL facz |
60 |
|
_RL rfac(nwtype),a1(nwtype),a2(nwtype) |
61 |
INTEGER i |
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 |
C |
71 |
C Jerlov water type : I IA IB II III |
C Jerlov water type : I IA IB II III |
72 |
C jwtype 1 2 3 4 5 |
C jwtype 1 2 3 4 5 |
74 |
DATA rfac / 0.58 , 0.62 , 0.67 , 0.77 , 0.78 / |
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 / |
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 / |
DATA a2 / 23.0 , 20.0 , 17.0 , 14.0 , 7.9 / |
77 |
C |
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 |
|
c print *,'swfrac: fac',fac |
85 |
|
c print *,'swfrac: first',first |
86 |
|
c print *,'swfrac: changed',changed |
87 |
|
c print *,'swfrac: count0',count0 |
88 |
|
c print *,'swfrac: count1',count1 |
89 |
|
c print *,'swfrac: myIter',myIter |
90 |
|
jwtype=jerl(count0) |
91 |
|
#else /* ALLOW_CALENDAR undef */ |
92 |
|
jwtype=2 |
93 |
|
#endif /* ALLOW_CALENDAR */ |
94 |
|
|
95 |
DO i = 1,imax |
DO i = 1,imax |
96 |
facz = fact*z(i) |
facz = fact*swdk(i) |
97 |
IF (facz .LT. (-200.)) THEN |
IF (facz .LT. (-200.)) THEN |
98 |
swdk(i) = 0. |
swdk(i) = 0. |
99 |
ELSE |
ELSE |
104 |
|
|
105 |
RETURN |
RETURN |
106 |
END |
END |
|
#endif |
|