make_LatLonGeomSpec_from_metadata.F90 Source File


This file depends on

sourcefile~~make_latlongeomspec_from_metadata.f90~~EfferentGraph sourcefile~make_latlongeomspec_from_metadata.f90 make_LatLonGeomSpec_from_metadata.F90 sourcefile~base.f90 Base.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~base.f90 sourcefile~coordinateaxis.f90 CoordinateAxis.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~coordinateaxis.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~errorhandling.f90 sourcefile~geomspec.f90 GeomSpec.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~geomspec.f90 sourcefile~latlongeomspec.f90 LatLonGeomSpec.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~latlongeomspec.f90 sourcefile~mapl_range.f90 MAPL_Range.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~mapl_range.f90 sourcefile~pfio.f90 pFIO.F90 sourcefile~make_latlongeomspec_from_metadata.f90->sourcefile~pfio.f90

Source Code

#include "MAPL_ErrLog.h"

submodule (mapl3g_LatLonGeomSpec) make_LatLonGeomSpec_from_metadata_smod
   use mapl3g_CoordinateAxis
   use mapl3g_GeomSpec
   use pfio
   use MAPL_RangeMod
   use MAPLBase_Mod
   use mapl_ErrorHandling
   use esmf
   implicit none (type, external)
   
contains

   ! File metadata section

   ! Unfortunately, we cannot quite compute each axis (lat - lon) independently,
   ! as the optimal decomposition depends on the ratio of the extens along each
   ! dimension.
   module function make_LatLonGeomSpec_from_metadata(file_metadata, rc) result(spec)
      type(LatLonGeomSpec) :: spec
      type(FileMetadata), intent(in) :: file_metadata
      integer, optional, intent(out) :: rc

      integer :: status
      type(LonAxis) :: lon_axis
      type(LatAxis) :: lat_axis
      type(LatLonDecomposition) :: decomposition

      lon_axis = make_LonAxis(file_metadata, _RC)
      lat_axis = make_LatAxis(file_metadata, _RC)

      associate (im_world => lon_axis%get_extent(), jm_world => lat_axis%get_extent())
        decomposition = make_LatLonDecomposition([im_world, jm_world], _RC)
      end associate
      spec = LatLonGeomSpec(lon_axis, lat_axis, decomposition)
      
      _RETURN(_SUCCESS)
   end function make_LatLonGeomSpec_from_metadata

end submodule make_LatLonGeomSpec_from_metadata_smod