/[MITgcm]/MITgcm/model/src/swfrac.F
ViewVC logotype

Contents of /MITgcm/model/src/swfrac.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.9.12.1 - (show annotations) (download)
Fri Dec 27 15:09:44 2002 UTC (21 years, 4 months ago) by cheisey
Branch: branch-exfmods-curt
CVS Tags: branch-exfmods-tag
Changes since 1.9: +7 -1 lines
Adding a branch "branch-exfmods-curt" for enhancements to
pkg/exf package (this is relative to tag checkpoint47e_post).

1 C $Header: /u/u0/gcmpack/MITgcm/model/src/swfrac.F,v 1.9 2001/09/26 18:09:16 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 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
96 facz = fact*swdk(i)
97 IF (facz .LT. (-200.)) THEN
98 swdk(i) = 0.
99 ELSE
100 swdk(i) = rfac(jwtype) * exp(facz/a1(jwtype))
101 $ + (1.-rfac(jwtype)) * exp(facz/a2(jwtype))
102 ENDIF
103 ENDDO
104
105 RETURN
106 END

  ViewVC Help
Powered by ViewVC 1.1.22