/[MITgcm]/MITgcm/pkg/exf/exf_zenithangle_table.F
ViewVC logotype

Contents of /MITgcm/pkg/exf/exf_zenithangle_table.F

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


Revision 1.5 - (show annotations) (download)
Tue Apr 2 13:05:55 2013 UTC (11 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64g, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
Changes since 1.4: +32 -39 lines
cleaning: remoive un-used DYNVARS.h include

1 C $Header: /u/gcmpack/MITgcm/pkg/exf/exf_zenithangle_table.F,v 1.4 2010/04/17 20:57:08 gforget Exp $
2 C $Name: $
3
4 #include "EXF_OPTIONS.h"
5
6 SUBROUTINE EXF_ZENITHANGLE_TABLE( myThid )
7
8 C ==================================================================
9 C SUBROUTINE exf_zenithangle_table
10 C ==================================================================
11 C
12 C o compute table of daily mean albedo that will be used in exf_zenithangle.F
13 C
14 C ==================================================================
15 C SUBROUTINE exf_zenithangle_table
16 C ==================================================================
17
18 IMPLICIT NONE
19
20 C == global variables ==
21 #include "EEPARAMS.h"
22 #include "SIZE.h"
23 #include "PARAMS.h"
24 #include "GRID.h"
25 #include "EXF_PARAM.h"
26 #include "EXF_FIELDS.h"
27 #include "EXF_CONSTANTS.h"
28
29 C == routine arguments ==
30 INTEGER myThid
31
32 #ifdef ALLOW_DOWNWARD_RADIATION
33 #ifdef ALLOW_ZENITHANGLE
34 C == local variables ==
35 INTEGER bi,bj
36 INTEGER i,j
37 _RL FSOL, dD0dDsq, SOLC, tmpINT1, tmpINT2
38 _RL LLLAT, TYEAR, TDAY, ALPHA, CZEN, ALBSEA1
39 _RL DECLI, ZS, ZC, SJ, CJ, TMPA, TMPB
40 INTEGER iLat,iTyear,iTday
41 C == end of interface ==
42
43 _BEGIN_MASTER( myThid )
44
45 C solar constant
46 C --------------
47 SOLC = 1368. _d 0
48
49 DO iLat=1,181
50 DO iTyear=1,366
51
52 LLLAT=(iLat-91. _d 0)
53 TYEAR=(iTyear-1. _d 0)/365. _d 0
54
55 C determine solar declination
56 C ---------------------------
57 C (formula from Hartmann textbook, after Spencer 1971)
58 ALPHA= 2. _d 0*PI*TYEAR
59 DECLI = 0.006918 _d 0
60 & - 0.399912 _d 0 * cos ( 1. _d 0 * ALPHA )
61 & + 0.070257 _d 0 * sin ( 1. _d 0 * ALPHA )
62 & - 0.006758 _d 0 * cos ( 2. _d 0 * ALPHA )
63 & + 0.000907 _d 0 * sin ( 2. _d 0 * ALPHA )
64 & - 0.002697 _d 0 * cos ( 3. _d 0 * ALPHA )
65 & + 0.001480 _d 0 * sin ( 3. _d 0 * ALPHA )
66
67 ZC = COS(DECLI)
68 ZS = SIN(DECLI)
69 SJ = SIN(LLLAT * deg2rad)
70 CJ = COS(LLLAT * deg2rad)
71 TMPA = SJ*ZS
72 TMPB = CJ*ZC
73
74 C compute squared earth-sun distance ratio
75 C ----------------------------------------
76 C (formula from Hartmann textbook, after Spencer 1971)
77 dD0dDsq = 1.000110 _d 0
78 & + 0.034221 _d 0 * cos ( 1. _d 0 * ALPHA )
79 & + 0.001280 _d 0 * sin ( 1. _d 0 * ALPHA )
80 & + 0.000719 _d 0 * cos ( 2. _d 0 * ALPHA )
81 & + 0.000077 _d 0 * sin ( 2. _d 0 * ALPHA )
82
83 tmpINT1=0. _d 0
84 tmpINT2=0. _d 0
85 DO iTday=1,100
86 TDAY=iTday/100. _d 0
87 C determine DAILY VARYING cos of solar zenith angle CZEN
88 C ------------------------------------------------------
89 CZEN = TMPA + TMPB *
90 & cos( 2. _d 0 *PI* TDAY + 0. _d 0 * deg2rad )
91 IF ( CZEN .LE.0 ) CZEN = 0. _d 0
92 C compute incoming flux at the top of the atm.:
93 C ---------------------------------------------
94 FSOL = SOLC * dD0dDsq * MAX( 0. _d 0, CZEN )
95 C determine direct ocean albedo
96 C -----------------------------
97 C (formula from Briegleb, Minnis, et al 1986)
98 ALBSEA1 = ( ( 2.6 _d 0 / (CZEN**(1.7 _d 0) + 0.065 _d 0) )
99 & + ( 15. _d 0 * (CZEN-0.1 _d 0) * (CZEN-0.5 _d 0)
100 & * (CZEN-1.0 _d 0) ) ) / 100.0 _d 0
101 C accumulate averages
102 C -------------------
103 tmpINT1=tmpINT1+FSOL*ALBSEA1/100. _d 0
104 tmpINT2=tmpINT2+FSOL/100. _d 0
105 ENDDO
106 C compute weighted average of albedo
107 C ----------------------------------
108 IF ( 0.5 _d 0 * tmpINT2 .GT. tmpINT1) THEN
109 zen_albedo_table(iTyear,iLat)=tmpINT1/tmpINT2
110 ELSE
111 zen_albedo_table(iTyear,iLat)=0.5 _d 0
112 ENDIF
113
114 ENDDO
115 ENDDO
116
117 _END_MASTER( myThid )
118 _BARRIER
119
120
121 C determine interpolation coefficient for each grid point
122 DO bj = myByLo(myThid),myByHi(myThid)
123 DO bi = myBxLo(myThid),myBxHi(myThid)
124 DO j = 1,sNy
125 DO i = 1,sNx
126 LLLAT=yC(i,j,bi,bj)+91. _d 0
127 C ensure that it is in valid range
128 LLLAT=max(LLLAT, 1. _d 0)
129 LLLAT=min(LLLAT, 181. _d 0)
130 C store
131 zen_albedo_pointer(i,j,bi,bj)=LLLAT
132 ENDDO
133 ENDDO
134 ENDDO
135 ENDDO
136
137 #endif /* ALLOW_ZENITHANGLE */
138 #endif /* ALLOW_DOWNWARD_RADIATION */
139
140 RETURN
141 END

  ViewVC Help
Powered by ViewVC 1.1.22