source: flexpart.git/src/zenithangle.f90 @ 3481cc1

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file since 3481cc1 was 3481cc1, checked in by Ignacio Pisso <ip@…>, 4 years ago

move license from headers to a different file

  • Property mode set to 100644
File size: 3.2 KB
Line 
1real function zenithangle(ylat,xlon,jul)
2
3  !*********************************************************************
4  !                                                                    *
5  !                      Author: G. WOTAWA                             *
6  !                      Date: 1993-11-17                              *
7  !                      Project: POP-M                                *
8  !                      Last update:                                  *
9  !                                                                    *
10  !*********************************************************************
11  !                                                                    *
12  !     DESCRIPTION: This function returns the sinus of solar          *
13  !                  elevation as a function of geographic longitude,  *
14  !                  latitude and GMT-Time.                            *
15  !                                                                    *
16  !*********************************************************************
17  !                                                                    *
18  !     INPUT:                                                         *
19  !                                                                    *
20  !            ylat          geographical latitude  [DEG]              *
21  !            xlon          geographical longitude [DEG]              *
22  !            jjjj          Year                                      *
23  !            mm            Month                                     *
24  !            dd            Day                                       *
25  !            hh            Hour                                      *
26  !            minute        Minute                                    *
27  !                                                                    *
28  !*********************************************************************
29
30  use par_mod, only: dp
31
32  implicit none
33
34  integer :: jjjj,mm,id,iu,minute,yyyymmdd,hhmmss
35  integer :: ndaynum
36  real :: sinsol,solelev,ylat,xlon
37  real :: rnum,rylat,ttime,dekl,rdekl,eq
38  real,parameter :: pi=3.1415927
39  real(kind=dp)  :: jul
40
41  call caldate(jul,yyyymmdd,hhmmss)
42  jjjj=yyyymmdd/10000
43  mm=yyyymmdd/100-jjjj*100
44  id=yyyymmdd-jjjj*10000-mm*100
45  iu=hhmmss/10000
46  minute=hhmmss/100-100*iu
47
48  ndaynum=31*(mm-1)+id
49  if(mm.gt.2) ndaynum=ndaynum-int(0.4*mm+2.3)
50  if((mm.gt.2).and.(jjjj/4*4.eq.jjjj)) ndaynum=ndaynum+1
51
52  rnum=2.*pi*ndaynum/365.
53  rylat=pi*ylat/180.
54  ttime=real(iu)+real(minute)/60.
55
56  dekl=0.396+3.631*sin(rnum)+0.038*sin(2.*rnum)+0.077*sin(3.*rnum)- &
57       22.97*cos(rnum)-0.389*cos(2.*rnum)-0.158*cos(3.*rnum)
58  rdekl=pi*dekl/180.
59
60  eq=(0.003-7.343*sin(rnum)-9.47*sin(2.*rnum)- &
61       0.329*sin(3.*rnum)-0.196*sin(4.*rnum)+ &
62       0.552*cos(rnum)-3.020*cos(2.*rnum)- &
63       0.076*cos(3.*rnum)-0.125*cos(4.*rnum))/60.
64
65  sinsol=sin(rylat)*sin(rdekl)+cos(rylat)*cos(rdekl)* &
66       cos((ttime-12.+xlon/15.+eq)*pi/12.)
67  ! Calculate the maximum solar elevation on that day
68  !sinsol=sin(rylat)*sin(rdekl)+cos(rylat)*cos(rdekl)*
69  !    &       cos((eq)*pi/12.)
70  solelev=asin(sinsol)*180./pi
71  zenithangle=90.-solelev
72
73  return
74end function zenithangle
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG