source: flexpart.git/src/zenithangle.f90

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

add SPDX-License-Identifier to all .f90 files

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