get_lon_corners.F90 Source File


This file depends on

sourcefile~~get_lon_corners.f90~~EfferentGraph sourcefile~get_lon_corners.f90 get_lon_corners.F90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~get_lon_corners.f90->sourcefile~errorhandling.f90 sourcefile~lonaxis.f90 LonAxis.F90 sourcefile~get_lon_corners.f90->sourcefile~lonaxis.f90 sourcefile~mapl_range.f90 MAPL_Range.F90 sourcefile~get_lon_corners.f90->sourcefile~mapl_range.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~coordinateaxis.f90 CoordinateAxis.F90 sourcefile~lonaxis.f90->sourcefile~coordinateaxis.f90 sourcefile~pfio.f90 pFIO.F90 sourcefile~lonaxis.f90->sourcefile~pfio.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~mapl_range.f90->sourcefile~mapl_exceptionhandling.f90

Source Code

#include "MAPL_ErrLog.h"

submodule (mapl3g_LonAxis) get_lon_corners_smod
   use mapl_RangeMod
   use mapl_ErrorHandling
   use esmf
   implicit none (type, external)
   integer, parameter :: R8 = ESMF_KIND_R8

contains

   module function get_lon_corners(centers) result(corners)
      real(kind=R8), intent(in) :: centers(:)
      real(kind=R8), allocatable :: corners(:)

      associate (im => size(centers))
        allocate(corners(im+1))
        corners(1) = (centers(im) + centers(1))/2 - 180
        corners(2:im) = (centers(1:im-1) + centers(2:im))/2
        corners(im+1) = (centers(im) + centers(1))/2 + 180
      end associate
   end function get_lon_corners

end submodule get_lon_corners_smod