source: trunk/WRF.COMMON/WRFV2/mars_lmd/libf/phymars/param_slope_full.F90 @ 3627

Last change on this file since 3627 was 11, checked in by aslmd, 14 years ago

spiga@svn-planeto:ajoute le modele meso-echelle martien

File size: 5.7 KB
Line 
1SUBROUTINE param_slope_full( &
2  !
3  ! INPUTS
4  !
5               &  ls, localtime, latitude, taudust, albedo  &
6               &  ,theta_s, psi_s &
7               &  ,ftot_0  &
8  !
9  ! OUTPUTS
10  !
11               &  ,ftot &
12 )
13
14
15!!*****************************************************************************************
16!
17! SUBROUTINE:
18! param_slope
19!
20!
21! PURPOSE:
22! computes total solar irradiance on a given Martian slope
23!
24!
25! INPUTS:
26! ls            aerocentric longitude (deg)
27! localtime     local true solar time (Martian hours)
28! latitude      latitude (deg)
29! taudust       dust optical depth at reference wavelength 0.67 mic.
30! albedo        spectrally integrated surface Lambertian reflection albedo
31! theta_s       slope inclination angle (deg)
32!                       0 is horizontal, 90 is vertical
33! phi_s         slope azimuth (deg)
34!                       0 >> Northward
35!                       90 >> Eastward
36!                       180 >> Southward
37!                       270 >> Westward
38! ftot_0        spectrally integrated total irradiance on an horizontal surface (W/m2)
39!
40!
41! OUTPUTS:
42! ftot          spectrally integrated total irradiance on the slope (W/m2)
43!
44! REFERENCE:
45! "Fast and accurate estimation of irradiance on Martian slopes"
46! A. Spiga & F. Forget
47! .....
48!
49! AUTHOR:
50! A. Spiga (spiga@lmd.jussieu.fr)
51! March 2008
52!
53!!*****************************************************************************************
54
55IMPLICIT NONE
56
57!!
58!! INPUT
59!!
60REAL, INTENT(IN) :: ls, localtime, latitude, taudust, theta_s, psi_s, albedo, ftot_0 
61
62!!
63!! LOCAL
64!!
65REAL :: pi, deg2rad, dist_sol, cste_mars
66REAL, PARAMETER :: p = 1.510404          ! Semi-latus rectum of Martian elliptic orbit (AU)
67REAL, PARAMETER :: e = 9.3357898E-02     ! Eccentricity of Martian elliptic orbit
68REAL, PARAMETER :: t = 1.908231          ! Angle from Ls=0 to the perihelion (radian)
69REAL, PARAMETER :: so = 0.4256214        ! sin(Obliquity of Martian axis)
70REAL :: rho, sdec, dec, cdec, csza, sza, ssza, psi0
71REAL :: px, py
72REAL :: a
73REAL :: mu_s, sigma_s
74REAL :: fdir, fdir_0, fscat, fscat_0, fref
75REAL, DIMENSION(4,2) :: mat_M, mat_N, mat_T
76REAL, DIMENSION(2) :: g_vector
77REAL, DIMENSION(4) :: s_vector
78REAL :: ratio
79
80!!
81!! OUTPUT
82!!
83REAL, INTENT(OUT) :: ftot
84
85!!*****************************************************************************************
86
87!
88! Prerequisite
89!
90  pi = 2.*asin(1.)
91  deg2rad = pi/180.
92  if ((theta_s > 90.) .or. (theta_s < 0.)) then
93        print *, 'please set theta_s between 0 and 90', theta_s
94        stop
95  endif
96
97!
98! Sun right ascension (radian)
99!
100  rho = pi*(1.0-localtime/12.0)
101
102!
103! Distance to sun (AU)
104!
105  dist_sol = p/(1.0+e*cos(deg2rad*Ls+t))   !! ellipse polar equation
106 
107!
108! Incident flux @ top of the atmosphere (Mars solar constant, W m-2)
109!
110  cste_mars=1370./(dist_sol*dist_sol)      !! 1370 W.m-2 is the solar constant at 1 AU.
111
112
113!!!!!!!!!!!!!!!!!!!!!!!!!!!
114!!! pour comparer avec spectres ESA
115!!!!!!!!!!!!!!!!!!!!!!!!!!!
116!cste_mars=cste_mars*0.92
117
118
119!
120! Sun declination (radian) [= subsolar point latitude]
121!
122  sdec = sin(deg2rad*Ls)*so
123  dec = asin(sdec) 
124  cdec = cos(dec)
125
126!
127! Solar Zenith angle (radian)
128!
129  csza = sin(deg2rad*latitude)*sdec + cos(deg2rad*latitude)*cdec*cos(rho)
130  sza = acos(csza)
131  ssza = sin(sza)
132  if (csza < 0.01) then
133      !print *, 'sun below horizon'
134      fdir_0=0.
135      fdir=0.
136      fscat_0=0.
137      fscat=0.   
138      fref=0.
139  else     
140
141!
142! 'Slope vs Sun' azimuth (radian)
143!
144  if ( ( (cdec*sin(rho)) .eq. 0.0 ) .and. ( ( sin(deg2rad*latitude)*cdec*cos(rho)-cos(deg2rad*latitude)*sdec ) .eq. 0.0 ) ) then
145    a = deg2rad*psi_s ! some compilator need specfying value for atan2(0,0) 
146  else
147    a = deg2rad*psi_s + atan2(cdec*sin(rho),sin(deg2rad*latitude)*cdec*cos(rho)-cos(deg2rad*latitude)*sdec)
148  end if
149 
150!
151! Cosine of slope-sun phase angle
152!
153  mu_s = csza*cos(deg2rad*theta_s) - cos(a)*sin(deg2rad*theta_s)*sqrt(1-csza**2)
154  if (mu_s .le. 0.) mu_s=0.
155
156!
157! Sky-view factor
158!
159  sigma_s=0.5*(1.+cos(deg2rad*theta_s))
160
161!
162! Direct flux on a flat surface
163!
164  fdir_0 = cste_mars*csza*exp(-taudust/csza)
165
166!
167! Direct flux on the slope
168!
169  fdir = fdir_0 * mu_s/csza
170
171!
172! Reflected flux on the slope
173!
174  fref = albedo * (1-sigma_s) * ftot_0
175
176!
177! Scattered flux on a flat surface
178!
179  fscat_0 = ftot_0 - fdir_0
180
181!
182! Scattering vector (slope vs sky)
183!
184  s_vector=(/ 1., exp(-taudust) , sin(deg2rad*theta_s), sin(deg2rad*theta_s)*exp(-taudust) /)
185
186!
187! Geometry vector (slope vs sun)
188!
189  g_vector=(/ mu_s/csza, 1. /)
190
191!
192! Coupling matrix
193!
194  if (csza .ge. 0.5) then
195        mat_M(:,1) = (/ -0.264,  1.309,  0.208, -0.828 /)
196        mat_M(:,2) = (/  1.291*sigma_s, -1.371*sigma_s, -0.581,  1.641 /)
197        mat_N(:,1) = (/  0.911, -0.777, -0.223,  0.623 /)
198        mat_N(:,2) = (/ -0.933*sigma_s,  0.822*sigma_s,  0.514, -1.195 /)
199
200  else
201        mat_M(:,1) = (/ -0.373,  0.792, -0.095,  0.398 /)
202        mat_M(:,2) = (/  1.389*sigma_s, -0.794*sigma_s, -0.325,  0.183 /)
203        mat_N(:,1) = (/  1.079,  0.275,  0.419, -1.855 /)
204        mat_N(:,2) = (/ -1.076*sigma_s, -0.357*sigma_s, -0.075,  1.844 /)
205  endif
206  !
207  mat_T = mat_M + csza*mat_N
208
209
210!
211! Scattered flux slope ratio
212!
213  if (deg2rad*theta_s <= 0.0872664626) then
214  !
215  ! low angles
216  !
217        s_vector = (/ 1., exp(-taudust) , sin(0.0872664626), sin(0.0872664626)*exp(-taudust) /)
218        ratio = DOT_PRODUCT ( MATMUL( s_vector, mat_T), g_vector )
219        ratio = 1. + (ratio - 1.)*deg2rad*theta_s/0.0872664626
220  else
221  !
222  ! general case
223  !
224        ratio= DOT_PRODUCT ( MATMUL( s_vector, mat_T), g_vector ) 
225                  !
226                  ! NB: ratio= DOT_PRODUCT ( s_vector, MATMUL( mat_T, g_vector ) ) is equivalent
227  endif
228
229!
230! Scattered flux on the slope
231!
232  fscat = ratio * fscat_0
233
234endif !! if (csza < 0.01)
235
236!
237! Total flux on the slope
238!
239  ftot = fdir + fref + fscat
240
241!!
242!! Display results
243!!
244!  print *, 'scattered component ', fscat
245!  print *, 'direct component ', fdir
246!  print *, 'reflected component ', fref
247
248END SUBROUTINE param_slope_full
Note: See TracBrowser for help on using the repository browser.