MAPL_SunOrbitCreateFromConfig Function

public function MAPL_SunOrbitCreateFromConfig(CF, CLOCK, FIX_SUN, RC) result(ORBIT)

The function MAPL_SunOrbitCreateFromConfig works like MAPL_SunOrbitCreate() but gets orbital parameters from Config CF.

Arguments

Type IntentOptional Attributes Name
type(ESMF_Config), intent(inout) :: CF
type(ESMF_Clock), intent(in) :: CLOCK
logical, intent(in) :: FIX_SUN
integer, intent(out), optional :: RC

Return Value type(MAPL_SunOrbit)


Calls

proc~~mapl_sunorbitcreatefromconfig~~CallsGraph proc~mapl_sunorbitcreatefromconfig MAPL_SunOrbitCreateFromConfig ESMF_ConfigGetAttribute ESMF_ConfigGetAttribute proc~mapl_sunorbitcreatefromconfig->ESMF_ConfigGetAttribute proc~mapl_return MAPL_Return proc~mapl_sunorbitcreatefromconfig->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_sunorbitcreatefromconfig->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Source Code

   function MAPL_SunOrbitCreateFromConfig ( &
      CF, CLOCK, FIX_SUN, RC) result (ORBIT)

! !ARGUMENTS:

      type (ESMF_Config), intent(INOUT) :: CF
      type (ESMF_Clock),  intent(IN   ) :: CLOCK
      logical,            intent(IN   ) :: FIX_SUN
      integer, optional,  intent(OUT  ) :: RC

      type (MAPL_SunOrbit)              :: ORBIT

      character(len=ESMF_MAXSTR), parameter :: IAm = "SunOrbitCreateFromConfig"
      integer :: STATUS

      real :: ECC, OB, PER
      integer :: EQNX

      logical :: EOT, ORBIT_ANAL2B
      integer :: ORB2B_REF_YYYYMMDD, ORB2B_REF_HHMMSS, &
           ORB2B_EQUINOX_YYYYMMDD, ORB2B_EQUINOX_HHMMSS
      real :: ORB2B_YEARLEN, &
           ORB2B_ECC_REF, ORB2B_ECC_RATE, &
           ORB2B_OBQ_REF, ORB2B_OBQ_RATE, &
           ORB2B_LAMBDAP_REF, ORB2B_LAMBDAP_RATE

      ! pmn: There is one orbit is per STATE, so, for example, the MAPL states of the
      ! solar and land gridded components can potentially have independent solar orbits.
      ! Usually these "independent orbits" will be IDENTICAL because the configuration
      ! resources such as "ECCENTRICITY:" or "EOT:" will not be qualified by the name
      ! of the gridded component. But for example, if the resource file specifies
      !   "EOT: .FALSE."
      ! but
      !   "SOLAR_EOT: .TRUE."
      ! then only SOLAR will have an EOT correction. The same goes for the new orbital
      ! system choice ORBIT_ANAL2B.
      !   A state's orbit is actually created in this routine by requesting the ORBIT
      ! object. If its not already created then it will be made below. GridComps that
      ! don't needed an orbit and dont request one will not have one.

      ! Parameters of standard orbital system (tabularized intercalation cycle)
      ! -----------------------------------------------------------------------
      call ESMF_ConfigGetAttribute (CF, &
         ECC, label="ECCENTRICITY:", &
         default=DEFAULT_ORBIT_ECCENTRICITY, _RC)

      call ESMF_ConfigGetAttribute (CF, &
         OB, label="OBLIQUITY:", &
         default=DEFAULT_ORBIT_OBLIQUITY, _RC)

      call ESMF_ConfigGetAttribute (CF, &
         PER, label="PERIHELION:", &
         default=DEFAULT_ORBIT_PERIHELION, _RC)

      call ESMF_ConfigGetAttribute (CF, &
         EQNX, label="EQUINOX:", &
         default=DEFAULT_ORBIT_EQUINOX, _RC)

      ! Apply Equation of Time correction?
      ! ----------------------------------
      call ESMF_ConfigGetAttribute (CF, &
         EOT, label="EOT:", &
         default=.FALSE., _RC)

      ! New orbital system (analytic two-body) allows some time-varying
      ! behavior, namely, linear variation in LAMBDAP, ECC, and OBQ.
      ! ---------------------------------------------------------------

      call ESMF_ConfigGetAttribute (CF, &
         ORBIT_ANAL2B, label="ORBIT_ANAL2B:", &
         default=.FALSE., _RC)

      ! Fixed anomalistic year length in mean solar days
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_YEARLEN, label="ORB2B_YEARLEN:", &
         default=DEFAULT_ORB2B_YEARLEN, _RC)

      ! Reference date and time for orbital parameters
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_REF_YYYYMMDD, label="ORB2B_REF_YYYYMMDD:", &
         default=DEFAULT_ORB2B_REF_YYYYMMDD, _RC)
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_REF_HHMMSS, label="ORB2B_REF_HHMMSS:", &
         default=DEFAULT_ORB2B_REF_HHMMSS, _RC)

      ! Orbital eccentricity at reference date
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_ECC_REF, label="ORB2B_ECC_REF:", &
         default=DEFAULT_ORB2B_ECC_REF, _RC)

      ! Rate of change of orbital eccentricity per Julian century
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_ECC_RATE, label="ORB2B_ECC_RATE:", &
         default=DEFAULT_ORB2B_ECC_RATE, _RC)

      ! Earth's obliquity (axial tilt) at reference date [degrees]
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_OBQ_REF, label="ORB2B_OBQ_REF:", &
         default=DEFAULT_ORB2B_OBQ_REF, _RC)

      ! Rate of change of obliquity [degrees per Julian century]
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_OBQ_RATE, label="ORB2B_OBQ_RATE:", &
         default=DEFAULT_ORB2B_OBQ_RATE, _RC)

      ! Longitude of perihelion at reference date [degrees]
      !   (from March equinox to perihelion in direction of earth's motion)
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_LAMBDAP_REF, label="ORB2B_LAMBDAP_REF:", &
         default=DEFAULT_ORB2B_LAMBDAP_REF, _RC)

      ! Rate of change of LAMBDAP [degrees per Julian century]
      !   (Combines both equatorial and ecliptic precession)
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_LAMBDAP_RATE, label="ORB2B_LAMBDAP_RATE:", &
         default=DEFAULT_ORB2B_LAMBDAP_RATE, _RC)

      ! March Equinox date and time
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_EQUINOX_YYYYMMDD, label="ORB2B_EQUINOX_YYYYMMDD:", &
         default=DEFAULT_ORB2B_EQUINOX_YYYYMMDD, _RC)
      call ESMF_ConfigGetAttribute (CF, &
         ORB2B_EQUINOX_HHMMSS, label="ORB2B_EQUINOX_HHMMSS:", &
         default=DEFAULT_ORB2B_EQUINOX_HHMMSS, _RC)

      ! create the orbit object
      ORBIT = MAPL_SunOrbitCreate ( &
         CLOCK, ECC, OB, PER, EQNX, &
         EOT, ORBIT_ANAL2B, ORB2B_YEARLEN, &
         ORB2B_REF_YYYYMMDD, ORB2B_REF_HHMMSS, &
         ORB2B_ECC_REF, ORB2B_ECC_RATE, &
         ORB2B_OBQ_REF, ORB2B_OBQ_RATE, &
         ORB2B_LAMBDAP_REF, ORB2B_LAMBDAP_RATE, &
         ORB2B_EQUINOX_YYYYMMDD, ORB2B_EQUINOX_HHMMSS, &
         FIX_SUN=FIX_SUN,_RC)

      _RETURN(ESMF_SUCCESS)

   end function MAPL_SunOrbitCreateFromConfig