-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'CoLM-SYSU:master' into master
- Loading branch information
Showing
13 changed files
with
1,284 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
#include <define.h> | ||
|
||
MODULE MOD_OrbCosazi | ||
|
||
!----------------------------------------------------------------------- | ||
USE MOD_Precision | ||
IMPLICIT NONE | ||
SAVE | ||
|
||
! PUBLIC MEMBER FUNCTIONS: | ||
PUBLIC :: orb_cosazi | ||
!----------------------------------------------------------------------- | ||
|
||
CONTAINS | ||
|
||
!----------------------------------------------------------------------- | ||
|
||
FUNCTION orb_cosazi(calday, dlon, dlat, coszen) | ||
|
||
!----------------------------------------------------------------------- | ||
USE MOD_Precision | ||
IMPLICIT NONE | ||
|
||
REAL(r8), intent(in) :: calday !Julian cal day (1.xx to 365.xx) | ||
REAL(r8), intent(in) :: dlat !Centered latitude (radians) | ||
REAL(r8), intent(in) :: dlon !Centered longitude (radians) | ||
REAL(r8), intent(in) :: coszen !cosine of sun zenith angle | ||
REAL(r8) :: orb_cosazi !cosine of sun azimuth angle | ||
|
||
! --- Local variables --- | ||
REAL(r8) declin !Solar declination (radians) | ||
REAL(r8) eccf !Earth-sun distance factor (ie. (1/r)**2) | ||
REAL(r8) lambm !Lambda m, mean long of perihelion (rad) | ||
REAL(r8) lmm !Intermediate argument involving lambm | ||
REAL(r8) lamb !Lambda, the earths long of perihelion | ||
REAL(r8) invrho !Inverse normalized sun/earth distance | ||
REAL(r8) sinl !Sine of lmm | ||
REAL(r8) pi !3.14159265358979323846... | ||
REAL(r8), parameter :: & | ||
dayspy=365.0, &!days per year | ||
ve=80.5, &!Calday of vernal equinox assumes Jan 1 = calday 1 | ||
eccen=1.672393084E-2, &!Eccentricity | ||
obliqr=0.409214646, &!Earths obliquity in radians | ||
lambm0=-3.2625366E-2, &!Mean long of perihelion at the vernal equinox (radians) | ||
mvelpp=4.92251015 !moving vernal equinox longitude of | ||
!perihelion plus pi (radians) | ||
!------------------------------------------------------------------------------- | ||
|
||
pi = 4.*atan(1.) | ||
lambm = lambm0 + (calday - ve)*2.*pi/dayspy | ||
lmm = lambm - mvelpp | ||
|
||
sinl = sin(lmm) | ||
lamb = lambm + eccen*(2.*sinl + eccen*(1.25*sin(2.*lmm) & | ||
+ eccen*((13.0/12.0)*sin(3.*lmm) - 0.25*sinl))) | ||
invrho = (1. + eccen*cos(lamb - mvelpp)) / (1. - eccen*eccen) | ||
|
||
declin = asin(sin(obliqr)*sin(lamb)) | ||
eccf = invrho*invrho | ||
|
||
orb_cosazi = (-1*cos(declin)*cos(calday*2.0*pi+dlon)- & | ||
coszen*cos(dlat))/(sin(dlat)*sqrt(1-coszen*coszen)) | ||
|
||
IF (orb_cosazi<-1) orb_cosazi = -1 | ||
IF (orb_cosazi>1) orb_cosazi = 1 | ||
|
||
END FUNCTION orb_cosazi | ||
|
||
END MODULE MOD_OrbCosazi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.