/[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.15 - (show annotations) (download)
Tue Aug 4 21:51:53 2009 UTC (14 years, 9 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62c, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62w, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint63g, checkpoint64, checkpoint62, checkpoint63, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint62b, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64t, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint61v, checkpoint61w, checkpoint61u, checkpoint61z, checkpoint61x, checkpoint61y
Changes since 1.14: +15 -15 lines
add missing "_d 0" in water type coeff.

1 C $Header: /u/gcmpack/MITgcm/model/src/swfrac.F,v 1.14 2007/09/04 16:49:44 jmc Exp $
2 C $Name: $
3
4 #include "PACKAGES_CONFIG.h"
5 #include "CPP_OPTIONS.h"
6
7 CBOP
8 C !ROUTINE: SWFRAC
9 C !INTERFACE:
10 SUBROUTINE SWFRAC(
11 I imax, fact,
12 U swdk,
13 I myTime, myIter, myThid )
14 C !DESCRIPTION: \bv
15 C *==========================================================*
16 C | SUBROUTINE SWFRAC
17 C | o Compute solar short-wave flux penetration.
18 C *==========================================================*
19 C | Compute fraction of solar short-wave flux penetrating to
20 C | specified depth, swdk, due to exponential decay in
21 C | Jerlov water type jwtype.
22 C | Reference : Two band solar absorption model of Paulson
23 C | and Simpson (1977, JPO, 7, 952-956)
24 C | Notes
25 C | =====
26 C | Parameter jwtype is hardcoded to 3 for time being.
27 C | Below 200m the solar penetration gets set to zero,
28 C | otherwise the limit for the exponent (+/- 5678) needs to
29 C | be taken care of.
30 C | Written by : Jan Morzel
31 C | Date : July 12, 1995
32 C *==========================================================*
33 C \ev
34
35 C !USES:
36 IMPLICIT NONE
37
38 C !INPUT/OUTPUT PARAMETERS:
39 C === Routine arguments ===
40 C input arguments
41 C imax :: number of vertical grid points
42 C fact :: scale factor to apply to depth array
43 C myTime :: Current time in simulation
44 C myIter :: Current iteration number in simulation
45 C myThid :: My Thread Id. number
46 INTEGER imax
47 _RL fact
48 _RL myTime
49 INTEGER myIter
50 INTEGER myThid
51 C input/output arguments
52 C swdk :: on input: vertical depth for desired sw fraction
53 C (fact*swdk) is negative distance (m) from surface
54 C swdk :: on output: short wave (radiation) fractional decay
55 _RL swdk(imax)
56
57 C !LOCAL VARIABLES:
58 C === Local variables ===
59 C max number of different water types
60 INTEGER nwtype , jwtype
61 PARAMETER(nwtype=5)
62 _RL facz
63 _RL rfac(nwtype),a1(nwtype),a2(nwtype)
64 INTEGER i
65 #ifdef ALLOW_CAL
66 c _RL fac
67 c LOGICAL first, changed
68 c INTEGER count0, count1
69 c INTEGER jerl(12)
70 c DATA jerl / 2 , 2 , 2 , 3 , 3 , 3 , 4 , 4 , 4 , 4 , 3 , 2 /
71 #endif /* ALLOW_CAL */
72 CEOP
73
74 C Jerlov water type :
75 C I IA IB II III
76 C jwtype : 1 2 3 4 5
77 DATA rfac / 0.58 _d 0, 0.62 _d 0, 0.67 _d 0, 0.77 _d 0, 0.78 _d 0/
78 DATA a1 / 0.35 _d 0, 0.6 _d 0, 1.0 _d 0, 1.5 _d 0, 1.4 _d 0/
79 DATA a2 / 23.0 _d 0, 20.0 _d 0, 17.0 _d 0, 14.0 _d 0, 7.9 _d 0/
80
81 #ifdef ALLOW_CAL
82 ceh3 this should have an IF ( useCALENDAR ) THEN
83 CML(
84 C myIter = 0 makes cal_getMonthsRec always return count0=12
85 C so that jerl(count0) = 2.
86 C The following lines are meant to be an example of how to
87 C include time dependent water types. However, it would probably
88 C make more sense to first think about a regionally varying
89 C water type before implementing a time dependence.
90 CML CALL cal_GetMonthsRec(
91 CML O fac, first, changed, count0, count1,
92 CML I myTime, myIter, myThid )
93 CML jwtype=jerl(count0)
94 CML)
95 jwtype=2
96 #else /* ALLOW_CAL undef */
97 jwtype=2
98 #endif /* ALLOW_CAL */
99
100 DO i = 1,imax
101 facz = fact*swdk(i)
102 IF ( facz .LT. -200. _d 0 ) THEN
103 swdk(i) = 0. _d 0
104 ELSE
105 swdk(i) = rfac(jwtype) * exp( facz/a1(jwtype) )
106 & + (1. _d 0 - rfac(jwtype)) * exp( facz/a2(jwtype) )
107 ENDIF
108 ENDDO
109
110 RETURN
111 END

  ViewVC Help
Powered by ViewVC 1.1.22