93 SUBROUTINE arc_dbl(XX1,YY1,XX2,YY2,ARCL)
105 REAL(DP) :: X1,Y1,X2,Y2,XA,YA,ZA,XB,YB,ZB,AB,AOB
106 REAL(DP),
INTENT(OUT) :: ARCL
107 REAL(DP),
INTENT(IN) :: XX1,YY1,XX2,YY2
124 ab=dsqrt((xb-xa)**2+(yb-ya)**2+(zb-za)**2)
125 aob=(2.0_dp -ab*ab)/2.0_dp
132 SUBROUTINE arc_flt(XX1,YY1,XX2,YY2,ARCL)
134 REAL(SPA),
INTENT(IN) :: XX1,YY1,XX2,YY2
135 REAL(SPA),
INTENT(OUT) :: ARCL
137 CALL arc_dbl(dble(xx1),dble(yy1),dble(xx2),dble(yy2),arcl_dp)
142 SUBROUTINE area_dbl(SIDEA,SIDEB,SIDEC,AREA1)
152 REAL(DP),
INTENT(IN) :: SIDEA,SIDEB,SIDEC
153 REAL(DP),
INTENT(OUT) :: AREA1
154 REAL(DP) :: SIDE1,SIDE2,SIDE3
155 REAL(DP) :: PSUM,PM,QMJC
166 psum=0.5_dp*(side1+side2+side3)
167 pm=dsin(psum)*dsin(psum-side1)*dsin(psum-side2)*dsin(psum-side3)
168 pm=dsqrt(pm)/(2.0_dp*dcos(side1*0.5_dp)*dcos(side2*0.5_dp)*dcos(side3*0.5_dp))
169 qmjc = 2.0_dp*dasin(pm)
178 SUBROUTINE area_flt(SIDE1,SIDE2,SIDE3,AREA1)
180 REAL(SPA),
INTENT(IN) :: SIDE1,SIDE2,SIDE3
181 REAL(SPA),
INTENT(OUT) :: AREA1
184 CALL area_dbl(dble(side1),dble(side2),dble(side3),area_dp)
190 SUBROUTINE arcc_dbl(XX1,YY1,XX2,YY2,XXC,YYC)
192 REAL(DP),
INTENT(OUT) :: XXC,YYC
193 REAL(DP),
INTENT(IN) :: XX1,YY1,XX2,YY2
194 REAL(DP) :: X1,Y1,X2,Y2
202 xxc=dcos(y1)*dsin(x1)+dcos(y2)*dsin(x2)
205 xxc=datan2(xxc,(dcos(y1)*dcos(x1)+dcos(y2)*dcos(x2)))
209 IF(xxc < 0.0_dp) xxc=360.0_dp+xxc
211 yyc=dcos(y1)*dcos(y1)+dcos(y2)*dcos(y2)+2.0_dp*dcos(y1)*dcos(y2)*dcos(x1-x2)
213 yyc=datan2(dsqrt(yyc),(dsin(y1)+dsin(y2)))
220 SUBROUTINE arcc_flt(XX1,YY1,XX2,YY2,XXC,YYC)
222 REAL(SPA) :: XX1,YY1,XX2,YY2
224 REAL(DP) :: XXC_DP,YYC_DP
226 CALL arcc_dbl(dble(xx1),dble(yy1),dble(xx2),dble(yy2),xxc_dp,yyc_dp)
233 SUBROUTINE arcx_dbl(XX1,YY1,XX2,YY2,ARCX1)
235 REAL(DP),
INTENT(IN) :: XX1,YY1,XX2,YY2
236 REAL(DP),
INTENT(OUT)::ARCX1
238 REAL(DP) :: X1,Y1,X2,Y2,TY
252 xtmp = real(-2*
pi,dp)+xtmp
253 ELSE IF(xtmp < -
pi)
THEN 254 xtmp = real(2*
pi,dp)+xtmp
258 arcx1=
rearth*dcos(ty)*xtmp
264 SUBROUTINE arcy_dbl(XX1,YY1,XX2,YY2,ARCY1)
266 REAL(DP),
INTENT(IN) :: XX1,YY1,XX2,YY2
267 REAL(DP),
INTENT(OUT)::ARCY1
269 REAL(DP) :: X1,Y1,X2,Y2,TY
283 ytmp = real(-2*
pi,dp)+ytmp
284 ELSE IF(ytmp < -
pi)
THEN 285 ytmp = real(2*
pi,dp)+ytmp
294 SUBROUTINE arcy_flt(XX1,YY1,XX2,YY2,ARCY1)
296 REAL(SPA),
INTENT(IN) :: XX1,YY1,XX2,YY2
297 REAL(SPA),
INTENT(OUT)::ARCY1
301 CALL arcy_dbl(dble(xx1),dble(yy1),dble(xx2),dble(yy2),arcy_dp)
306 SUBROUTINE arcx_flt(XX1,YY1,XX2,YY2,ARCX1)
308 REAL(SPA),
INTENT(IN) :: XX1,YY1,XX2,YY2
309 REAL(SPA),
INTENT(OUT)::ARCX1
313 CALL arcx_dbl(dble(xx1),dble(yy1),dble(xx2),dble(yy2),arcx_dp)
320 REAL(DP),
INTENT(IN) :: XX1,YY1,XX2,YY2
321 REAL(DP),
INTENT(OUT) :: ARCX1
324 INTEGER,
PARAMETER ::NX=500
325 REAL(DP) :: X1,Y1,X2,Y2,TY,A1,A2,B1,B2,C1,C2,A,B,C,X(NX+1),Y(NX+1)
344 xtmp = real(-2*
pi,dp)+xtmp
345 ELSE IF(xtmp < -
pi)
THEN 346 xtmp = real(2*
pi,dp)+xtmp
350 x(i)=x(i-1)+xtmp/float(nx)
354 a1=dcos(y(1))*dcos(x(1))
355 a2=dcos(y(nx+1))*dcos(x(nx+1))
357 b1=dcos(y(1))*dsin(x(1))
358 b2=dcos(y(nx+1))*dsin(x(nx+1))
368 y(i)=-b*dcos(x(i))-c*dsin(x(i))
378 xtmp = real(-2*
pi,dp)+xtmp
379 ELSE IF(xtmp < -
pi)
THEN 380 xtmp = real(2*
pi,dp)+xtmp
382 arcx1=arcx1+
rearth*dcos(ty)*xtmp
392 REAL(SPA),
INTENT(IN) :: XX1,YY1,XX2,YY2
393 REAL(SPA),
INTENT(OUT)::ARCX1
397 CALL arcx_back_dbl(dble(xx1),dble(yy1),dble(xx2),dble(yy2),arcx_dp)
real(sp), dimension(:,:), allocatable dltxne
subroutine arcy_dbl(XX1, YY1, XX2, YY2, ARCY1)
subroutine arcx_back_flt(XX1, YY1, XX2, YY2, ARCX1)
real(dp), parameter rearth
real(sp), dimension(:,:), allocatable deltux
real(sp), dimension(:,:), allocatable sitau
subroutine arcy_flt(XX1, YY1, XX2, YY2, ARCY1)
subroutine arcx_flt(XX1, YY1, XX2, YY2, ARCX1)
real(sp), dimension(:,:), allocatable dltyne
subroutine arcc_flt(XX1, YY1, XX2, YY2, XXC, YYC)
subroutine arcx_dbl(XX1, YY1, XX2, YY2, ARCX1)
subroutine area_flt(SIDE1, SIDE2, SIDE3, AREA1)
real(sp), dimension(:,:), allocatable deltuy
real(dp), parameter deg2rad
subroutine arcx_back_dbl(XX1, YY1, XX2, YY2, ARCX1)
subroutine arc_dbl(XX1, YY1, XX2, YY2, ARCL)
subroutine alloc_sphere_vars
subroutine area_dbl(SIDEA, SIDEB, SIDEC, AREA1)
subroutine arcc_dbl(XX1, YY1, XX2, YY2, XXC, YYC)
subroutine arc_flt(XX1, YY1, XX2, YY2, ARCL)