cbl_sinbet.F90 Source File


This file depends on

sourcefile~~cbl_sinbet.f90~~EfferentGraph sourcefile~cbl_sinbet.f90 cbl_sinbet.F90 sourcefile~cable_maths_constants_mod.f90 cable_maths_constants_mod.F90 sourcefile~cbl_sinbet.f90->sourcefile~cable_maths_constants_mod.f90

Files dependent on this one

sourcefile~~cbl_sinbet.f90~~AfferentGraph sourcefile~cbl_sinbet.f90 cbl_sinbet.F90 sourcefile~cable_input.f90 cable_input.F90 sourcefile~cable_input.f90->sourcefile~cbl_sinbet.f90 sourcefile~cable_driver_common.f90 cable_driver_common.F90 sourcefile~cable_driver_common.f90->sourcefile~cable_input.f90 sourcefile~cable_mpimaster.f90 cable_mpimaster.F90 sourcefile~cable_mpimaster.f90->sourcefile~cable_input.f90 sourcefile~cable_mpimaster.f90->sourcefile~cable_driver_common.f90 sourcefile~cable_mpiworker.f90 cable_mpiworker.F90 sourcefile~cable_mpiworker.f90->sourcefile~cable_input.f90 sourcefile~cable_mpiworker.f90->sourcefile~cable_driver_common.f90 sourcefile~cable_serial.f90 cable_serial.F90 sourcefile~cable_serial.f90->sourcefile~cable_input.f90 sourcefile~cable_serial.f90->sourcefile~cable_driver_common.f90 sourcefile~cable_offline_driver.f90 cable_offline_driver.F90 sourcefile~cable_offline_driver.f90->sourcefile~cable_driver_common.f90 sourcefile~cable_offline_driver.f90->sourcefile~cable_serial.f90

Source Code

MODULE cbl_sinbet_mod

PUBLIC sinbet

contains

ELEMENTAL FUNCTION sinbet(doy,xslat,hod) RESULT(z)

USE cable_math_constants_mod, ONLY : PI, PI180
! calculate sin(bet), bet = elevation angle of sun
! calculations according to goudriaan & van laar 1994 p30
REAL, INTENT(IN) ::                                                         &
  doy,     & ! day of year
  xslat,   & ! latitude (degrees north)
  hod        ! hour of day

REAL ::                                                                     &
  sindec,  & ! sine of maximum declination
  z          ! result

sindec = -SIN( 23.45 * PI180 ) * COS( 2. * PI * ( doy + 10.0 ) / 365.0 )

z = MAX( SIN( PI180 * xslat ) * sindec                                 &
     + COS( PI180 * xslat ) * SQRT( 1. - sindec * sindec )              &
     * COS( PI * ( hod - 12.0 ) / 12.0 ), 1e-8 )

END FUNCTION sinbet

End MODULE cbl_sinbet_mod