Go to the documentation of this file.
31 public :: atmos_solarins_insolation
34 interface atmos_solarins_insolation
37 end interface atmos_solarins_insolation
71 real(
rp),
private :: obliquity
72 real(
rp),
private :: e
73 real(
rp),
private :: omega
74 real(
rp),
private :: lambda_m0
76 integer,
private,
parameter :: year_ref = 1950
77 integer,
private :: ve_date(6)
78 data ve_date / 2000, 3, 20, 7, 35, 0 /
80 real(
rp),
private,
parameter :: obliquity_ref = 23.320556_rp
81 real(
rp),
private,
parameter :: psi_bar = 50.439273_rp
82 real(
rp),
private,
parameter :: zeta = 3.392506_rp
84 real(
dp),
private :: caldaysec
85 real(
dp),
private :: calyearday
86 real(
dp),
private :: soldaysec
87 real(
dp),
private :: solyearsec
88 logical,
private :: day_calender_synced = .true.
89 logical,
private :: year_calender_synced = .true.
93 integer,
private,
parameter :: nobliq = 47
94 real(
rp),
private :: obliq_amp (nobliq)
95 real(
rp),
private :: obliq_rate (nobliq)
96 real(
rp),
private :: obliq_phase(nobliq)
245 integer,
private,
parameter :: neclip = 19
246 real(
rp),
private :: eclip_amp (neclip)
247 real(
rp),
private :: eclip_rate (neclip)
248 real(
rp),
private :: eclip_phase(neclip)
313 integer,
private,
parameter :: nprece = 78
314 real(
rp),
private :: prece_amp (nprece)
315 real(
rp),
private :: prece_rate (nprece)
316 real(
rp),
private :: prece_phase(nprece)
558 real(
rp),
private :: arcsec2d, arcsec2r
560 logical,
private :: debug = .false.
568 basepoint_lon, basepoint_lat, &
588 integer,
intent(in) :: iyear
589 real(
rp),
intent(in) :: basepoint_lon
590 real(
rp),
intent(in) :: basepoint_lat
592 namelist / param_atmos_solarins / &
613 real(
rp) :: re_factor, sindec, cosdec, hourangle
614 real(
dp) :: lambda, subsec
615 character(len=27) :: datechar
621 log_info(
"ATMOS_SOLARINS_setup",*)
'Setup'
631 read(
io_fid_conf,nml=param_atmos_solarins,iostat=ierr)
633 log_info(
"ATMOS_SOLARINS_setup",*)
'Not found namelist. Default used.'
634 elseif( ierr > 0 )
then
635 log_error(
"ATMOS_SOLARINS_setup",*)
'Not appropriate names in namelist PARAM_ATMOS_SOLARINS. Check!'
638 log_nml(param_atmos_solarins)
663 arcsec2d = 1.0_rp / (60.0_rp*60.0_rp)
678 solyearsec = calyearday*caldaysec
682 year_calender_synced = .false.
686 soldaysec = caldaysec
690 day_calender_synced = .false.
694 calyearday = 365.2425_dp
696 solyearsec = calyearday*caldaysec
697 soldaysec = caldaysec
702 dyear = real( year-year_ref, kind=
rp )
706 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A)')
'Solar insolation parameters '
707 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,I7)')
'Reference year : ', year_ref
708 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,I7)')
'Current year : ', year
709 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,I7)')
'Difference from ref. : ', int(dyear)
712 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F12.7)')
'Obliquity [deg] : ', obliquity /
const_d2r
713 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F12.7)')
'Eccentricity : ', e
714 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F12.7)')
'Longitude of perihelion [deg] : ', omega /
const_d2r
717 if ( year_calender_synced )
then
718 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A )')
'Solar annual cycle is synced with calendar'
720 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A )')
'Solar annual cycle is not synced with calendar'
722 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F14.4)')
'Solar annual cycle [sec] : ', solyearsec
723 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F14.4)')
'Solar annual cycle [day] : ', solyearsec/caldaysec
724 if ( day_calender_synced )
then
725 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A )')
'Solar diurnal cycle is synced with calendar'
727 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A )')
'Solar diurnal cycle is not synced with calendar'
729 log_info(
"ATMOS_SOLARINS_setup",
'(1x,A,F14.4)')
'Solar diurnal cycle [sec] : ', soldaysec
745 log_info(
"ATMOS_SOLARINS_setup",*)
'Orbit info for next 1 solar year'
746 if (
io_l)
write(
io_fid_log,
'(A)')
'DATE SOLAR_CONST, Scaled dist from star, Longitude'
756 lambda_out = lambda &
759 if (lambda < 0.0_rp)
then
783 integer,
intent(in) :: iyear
789 real(
rp) :: perih_psi
790 real(
rp) :: perih_omega
792 real(
rp) :: temp, beta, ecosomg_mod
798 dyear = real( iyear-year_ref, kind=
rp )
803 temp = temp + obliq_amp(i)*arcsec2d * cos( obliq_rate(i)*arcsec2r*dyear + obliq_phase(i)*d2r )
805 obliquity = ( obliquity_ref + temp ) * d2r
811 esinomg = esinomg + eclip_amp(i) * sin( eclip_rate(i)*arcsec2r*dyear + eclip_phase(i)*d2r )
812 ecosomg = ecosomg + eclip_amp(i) * cos( eclip_rate(i)*arcsec2r*dyear + eclip_phase(i)*d2r )
814 e = sqrt( esinomg*esinomg + ecosomg*ecosomg )
817 if ( ecosomg == 0.0_rp )
then
818 ecosomg_mod = 1.e-30_rp
820 ecosomg_mod = ecosomg
822 perih_pi = atan(esinomg/ecosomg_mod) + pi * ( 0.5_rp - sign(0.5_rp, ecosomg) )
846 perih_pi = perih_pi / d2r
851 temp = temp + prece_amp(i)*arcsec2d * sin( prece_rate(i)*arcsec2r*dyear + prece_phase(i)*d2r )
853 perih_psi = psi_bar * arcsec2d * dyear + zeta + temp
856 perih_omega = perih_pi + perih_psi
859 if ( perih_omega + 180.0_rp < 0.0_rp )
then
860 perih_omega = perih_omega + 360.0_rp
861 elseif( perih_omega + 180.0_rp >= 360.0_rp )
then
862 perih_omega = perih_omega - 360.0_rp
869 omega = ( perih_omega + 180.0_rp ) * d2r
883 beta = sqrt( 1.0_rp - e*e )
886 lambda_m0 = 2.0_rp * ( ( 1.0_rp/2.0_rp*e + 1.0_rp/8.0_rp*e*e*e ) * ( 1.0_rp + beta ) * sin( omega) &
887 - ( 1.0_rp/4.0_rp*e*e ) * ( 1.0_rp/2.0_rp + beta ) * sin(2.0_rp*omega) &
888 + ( 1.0_rp/8.0_rp*e*e*e ) * ( 1.0_rp/3.0_rp + beta ) * sin(3.0_rp*omega) )
913 real(
rp),
intent(out) :: re_factor
914 real(
rp),
intent(out) :: sindec
915 real(
rp),
intent(out) :: cosdec
916 real(
rp),
intent(out) :: hourangle
917 integer,
intent(in) :: now_date(6)
918 integer,
intent(in) :: offset_year
919 real(
dp),
intent(out),
optional :: lambda_out
924 integer :: absday, absday_ve
925 real(
dp) :: abssec, abssec_ve
926 real(
dp) :: diffday, diffyr, diffsec
934 date(:) = now_date(:)
971 if ( year_calender_synced )
then
972 diffday = real(absday-absday_ve,kind=
dp) + (abssec-abssec_ve) / caldaysec
973 diffyr = diffday / calyearday - real( nint( diffday / calyearday ),kind=
dp)
975 diffsec = real(absday-absday_ve,kind=
dp)*caldaysec + (abssec-abssec_ve)
976 diffyr = diffsec / solyearsec - real( nint( diffsec / solyearsec ),kind=
dp)
979 lambda_m = lambda_m0 + 2.0_rp * pi * diffyr
981 nu = lambda_m - omega
985 + 2.0_dp*e * cos( nu ) &
986 + 0.5_dp*e*e * cos( 2.0_dp*nu ) &
988 + 4.0_dp*e*e*e * cos( 3.0_dp*nu )
992 + ( 2.0_dp*e - 1.0_dp/ 4.0_dp*e*e*e ) * sin( nu ) &
993 + ( 5.0_dp/ 4.0_dp*e*e ) * sin( 2.0_dp*nu ) &
994 + ( 13.0_dp/12.0_dp*e*e*e ) * sin( 3.0_dp*nu )
997 sindec = sin(lambda) * sin(obliquity)
998 cosdec = sqrt( 1.0_rp - sindec*sindec )
1001 if ( day_calender_synced )
then
1002 hourangle = pi + 2.0_rp * pi * abssec / caldaysec
1004 hourangle = pi + 2.0_rp * pi &
1006 - real( nint((absday*caldaysec + abssec)/ soldaysec ),kind=
dp) )
1010 log_info(
"ATMOS_SOLARINS_ecliptic_longitude",*) lambda_m, nu, lambda, re_factor
1013 if (
present(lambda_out) ) lambda_out = lambda
1021 real_lon, real_lat, &
1022 now_date, offset_year, &
1028 real(RP),
intent(in) :: real_lon
1029 real(RP),
intent(in) :: real_lat
1030 integer,
intent(in) :: now_date(6)
1031 integer,
intent(in) :: offset_year
1033 real(RP),
intent(out) :: solins
1034 real(RP),
intent(out) :: cosSZA
1035 real(RP),
intent(out),
optional :: Re_factor_out
1037 real(RP) :: Re_factor
1038 real(RP) :: sinDEC, cosDEC
1039 real(RP) :: hourangle
1060 cossza = sin(lat)*sindec + cos(lat)*cosdec*cos(lon+hourangle)
1063 if (
present( re_factor_out ) )
then
1064 re_factor_out = re_factor
1073 IA, IS, IE, JA, JS, JE, &
1074 real_lon, real_lat, &
1075 now_date, offset_year, &
1080 integer,
intent(in) :: IA, IS, IE
1081 integer,
intent(in) :: JA, JS, JE
1083 real(RP),
intent(in) :: real_lon(IA,JA)
1084 real(RP),
intent(in) :: real_lat(IA,JA)
1085 integer,
intent(in) :: now_date(6)
1086 integer,
intent(in) :: offset_year
1088 real(RP),
intent(out) :: solins (IA,JA)
1089 real(RP),
intent(out) :: cosSZA (IA,JA)
1091 real(RP) :: Re_factor
1092 real(RP) :: sinDEC, cosDEC
1093 real(RP) :: hourangle
1095 real(RP) :: lon(IA,JA)
1096 real(RP) :: lat(IA,JA)
1125 lon(i,j) = real_lon(i,j)
1126 lat(i,j) = real_lat(i,j)
1136 cossza(i,j) = sin(lat(i,j))*sindec + cos(lat(i,j))*cosdec*cos(lon(i,j)+hourangle)
subroutine, public atmos_solarins_orbit(iyear)
setup solar incidence module
subroutine, public prc_abort
Abort Process.
integer, parameter, public i_min
[index] minute
subroutine, public calendar_daysec2date(ymdhms, subsec, absday, abssec, offset_year)
Convert from gregorian date to absolute day/second.
logical, public atmos_solarins_fixedlatlon
subroutine, public atmos_solarins_setup(basepoint_lon, basepoint_lat, iyear)
setup solar incidence module
real(rp), public atmos_solarins_constant
subroutine atmos_solarins_insolation_0d(real_lon, real_lat, now_date, offset_year, solins, cosSZA, Re_factor_out)
calc factor of Earths solar insolation
logical, public atmos_solarins_set_ideal
real(rp), public const_eps
small number
subroutine, public calendar_hms2abssec(abssec, hour, minute, second, subsec)
Hour, minute, second, subsecond -> absolute second.
module atmosphere / SOLARINS
real(dp), public time_nowsec
subday part of current time [sec]
integer, parameter, public rp
subroutine atmos_solarins_insolation_2d(IA, IS, IE, JA, JS, JE, real_lon, real_lat, now_date, offset_year, solins, cosSZA)
calc factor of Earths solar insolation
real(rp), public atmos_solarins_annual_sec
real(dp), public calendar_min
minutes of hour
real(rp), public atmos_solarins_perihelion_lon
subroutine, public calendar_ymd2absday(absday, gyear, gmonth, gday, oyear)
Convert from gregorian date to absolute day, DAY 0 is AD1/1/1.
integer, parameter, public i_hour
[index] hour
integer, public io_fid_log
Log file ID.
subroutine, public calendar_date2daysec(absday, abssec, ymdhms, subsec, offset_year)
Convert from gregorian date to absolute day/second.
real(dp), public calendar_sec
seconds of minute
real(rp), public atmos_solarins_lat
logical, public atmos_solarins_set_ve
integer, parameter, public dp
real(rp), parameter, public const_pi
pi
integer, parameter, public i_month
[index] month
real(rp), public atmos_solarins_lon
real(rp), public atmos_solarins_diurnal_sec
subroutine, public atmos_solarins_ecliptic_longitude(Re_factor, sinDEC, cosDEC, hourangle, now_date, offset_year, lambda_out)
calc factor of Earths solar insolation
real(rp), public atmos_solarins_obliquity
real(dp), public calendar_hour
hours of day
logical, public io_l
output log or not? (this process)
integer, dimension(6), public atmos_solarins_ve_date
real(rp), public const_d2r
degree to radian
integer, parameter, public i_year
[index] year
integer, parameter, public i_day
[index] day
real(rp), public atmos_solarins_eccentricity
real(rp), public const_undef
integer, dimension(6), public atmos_solarins_date
real(dp), public calendar_doi
days of year
integer, public io_fid_conf
Config file ID.
integer, public time_offset_year
time offset [year]
integer, public time_nowday
absolute day of current time [day]
subroutine, public calendar_date2char(chardate, ymdhms, subsec)
Convert from gregorian date to absolute day/second.
integer, parameter, public i_sec
[index] second
logical, public atmos_solarins_fixeddate