Go to the documentation of this file.00001
00002 subroutine init_solar_dec( time )
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 use kinds
00015 use timetype
00016 use sib_const_module
00017 use physical_parameters
00018 implicit none
00019
00020
00021 type(time_struct), intent(in) :: time
00022
00023
00024 real(kind=real_kind) :: t1
00025 real(kind=real_kind) :: t2
00026 real(kind=real_kind) :: t3
00027 real(kind=real_kind) :: t4
00028 integer(kind=int_kind) :: iday
00029 real(kind=real_kind) :: rt_asc
00030
00031
00032 iday = time%doy - eqnx
00033 if ( iday < 0 ) iday = iday + time%days_per_year
00034 lonearth=0.0
00035 if ( iday /= 0 ) then
00036 do while ( iday > 0 )
00037 iday = iday - 1
00038 t1 = rt_asc( lonearth ) * pidaypy
00039 t2 = rt_asc( lonearth+t1*.5 ) * pidaypy
00040 t3 = rt_asc( lonearth+t2*.5 ) * pidaypy
00041 t4 = rt_asc( lonearth+t3 ) * pidaypy
00042 lonearth = lonearth + (t1+2.*(t2+t3)+t4) / 6.
00043 enddo
00044 endif
00045
00046 end subroutine init_solar_dec
00047
00048
00049
00050 subroutine solar_dec( time )
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062 use kinds
00063 use timetype
00064 use sib_const_module
00065 use physical_parameters
00066 implicit none
00067
00068
00069 type(time_struct), intent(in) :: time
00070
00071
00072 real(kind=real_kind) :: t1
00073 real(kind=real_kind) :: t2
00074 real(kind=real_kind) :: t3
00075 real(kind=real_kind) :: t4
00076 integer(kind=int_kind) :: iday
00077 real(kind=real_kind) :: rt_asc
00078
00079
00080 if( time%doy == eqnx ) lonearth = 0.0
00081
00082
00083 t1 = rt_asc( lonearth ) * pidaypy
00084 t2 = rt_asc( lonearth+t1*.5 ) * pidaypy
00085 t3 = rt_asc( lonearth+t2*.5 ) * pidaypy
00086 t4 = rt_asc( lonearth+t3 ) * pidaypy
00087 lonearth = lonearth + (t1+2.*(t2+t3)+t4) / 6.
00088
00089
00090 sin_dec = sin( decmax*(pi/180.) ) * sin( lonearth )
00091 cos_dec = sqrt( 1. - sin_dec * sin_dec )
00092
00093
00094 end subroutine solar_dec
00095
00096
00097
00098 function rt_asc( ang )
00099
00100
00101
00102
00103
00104 use kinds
00105 use sib_const_module
00106 use physical_parameters
00107 implicit none
00108
00109 real(kind=real_kind) :: rt_asc
00110 real(kind=real_kind) :: ang
00111
00112
00113 real(kind=real_kind) :: reccn
00114 real(kind=real_kind) :: perhlr
00115
00116
00117 reccn = 1. / (1. - eccn * eccn ) **1.5
00118 perhlr = perhl * (pi/180.)
00119 rt_asc = reccn * (1. - eccn * cos( ang - perhlr ) ) **2
00120
00121 end function rt_asc
00122
00123
00124
00125 subroutine mean_zenith_angle( sib, time )
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 use kinds
00141 use sibtype
00142 use timetype
00143 use sib_const_module
00144 implicit none
00145
00146
00147 type(sib_t), dimension(subcount), intent(inout) :: sib
00148 type(time_struct), intent(in) :: time
00149
00150
00151 integer i
00152 integer n
00153 integer nsteps
00154 real loctofday
00155
00156
00157
00158 sib(:)%stat%coszbar = 0.
00159 sib(:)%stat%dayflag = 0.
00160
00161
00162 nsteps = time%driver_step / time%dtsib
00163
00164
00165 loctofday = time%hour
00166 do n = 1, nsteps
00167
00168
00169
00170 call zenith_angle ( loctofday, sib(:)%stat%cosz )
00171
00172
00173
00174
00175 do i = 1, subcount
00176 if( sib(i)%stat%cosz > cosz_min ) then
00177 sib(i)%stat%dayflag = sib(i)%stat%dayflag + 1.
00178 sib(i)%stat%coszbar = sib(i)%stat%coszbar + &
00179 sib(i)%stat%cosz - cosz_min
00180 endif
00181 enddo
00182
00183
00184 loctofday = loctofday + real(time%dtsib)/3600.
00185 enddo
00186
00187
00188 do i = 1, subcount
00189 if( sib(i)%stat%coszbar > 0. ) &
00190 sib(i)%stat%coszbar = sib(i)%stat%coszbar / nsteps
00191 enddo
00192
00193 end subroutine mean_zenith_angle
00194
00195
00196
00197 subroutine zenith_angle ( hour, cosz )
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 use kinds
00210 use sib_const_module
00211 implicit none
00212
00213
00214 real(kind=real_kind), intent(in) :: hour
00215 real(kind=dbl_kind), dimension(subcount), intent(out) :: cosz
00216
00217
00218 real pid180
00219 real sinlat
00220 real coslat
00221 real hrang
00222 real cos_hour
00223 integer i
00224
00225
00226 pid180 = 3.14159/180.
00227
00228
00229 hrang = (12. - hour) * 360. / 24.
00230
00231
00232 do i = 1,subcount
00233 cos_hour = cos( pid180 * ( hrang - lonsib(subset(i)) ) )
00234 sinlat = sin( pid180 * latsib(subset(i)) )
00235 coslat = cos( pid180 * latsib(subset(i)) )
00236 cosz(i) = coslat * cos_dec * cos_hour + sinlat * sin_dec
00237 enddo
00238
00239 end subroutine zenith_angle
00240