Skip to content

Commit

Permalink
fix: move type definitions to before first usage to fix nvhpc bug (NO…
Browse files Browse the repository at this point in the history
  • Loading branch information
rem1776 authored and rem1776 committed May 25, 2023
1 parent 99a1400 commit 91757f5
Showing 1 changed file with 39 additions and 38 deletions.
77 changes: 39 additions & 38 deletions horiz_interp/horiz_interp_type.F90
Original file line number Diff line number Diff line change
Expand Up @@ -57,44 +57,6 @@ module horiz_interp_type_mod
module procedure stats_r8
end interface

!> Holds data pointers and metadata for horizontal interpolations, passed between the horiz_interp modules
!> @ingroup horiz_interp_type_mod
type horiz_interp_type
integer, dimension(:,:), allocatable :: ilon !< indices for conservative scheme
integer, dimension(:,:), allocatable :: jlat !< indices for conservative scheme
!! wti ist used for derivative "weights" in bicubic
integer, dimension(:,:,:), allocatable :: i_lon !< indices for bilinear interpolation
!! and spherical regrid
integer, dimension(:,:,:), allocatable :: j_lat !< indices for bilinear interpolation
!! and spherical regrid
logical, dimension(:,:), allocatable :: found_neighbors !< indicate whether destination grid
!! has some source grid around it.
integer, dimension(:,:), allocatable :: num_found
integer :: nlon_src !< size of source grid
integer :: nlat_src !< size of source grid
integer :: nlon_dst !< size of destination grid
integer :: nlat_dst !< size of destination grid
integer :: interp_method !< interpolation method.
!! =1, conservative scheme
!! =2, bilinear interpolation
!! =3, spherical regrid
!! =4, bicubic regrid
logical :: I_am_initialized=.false.
integer :: version !< indicate conservative
!! interpolation version with value 1 or 2
!--- The following are for conservative interpolation scheme version 2 ( through xgrid)
integer :: nxgrid !< number of exchange grid
!! between src and dst grid.
integer, dimension(:), allocatable :: i_src !< indices in source grid.
integer, dimension(:), allocatable :: j_src !< indices in source grid.
integer, dimension(:), allocatable :: i_dst !< indices in destination grid.
integer, dimension(:), allocatable :: j_dst !< indices in destination grid.
type(horizInterpReals8_type), allocatable :: horizInterpReals8_type !< derived type holding kind 8 real data pointers
!! if compiled with r8_kind
type(horizInterpReals4_type), allocatable :: horizInterpReals4_type !< derived type holding kind 4 real data pointers
!! if compiled with r8_kind

end type

!> real(8) pointers for use in horiz_interp_type
type horizInterpReals8_type
Expand Down Expand Up @@ -148,6 +110,45 @@ module horiz_interp_type_mod

end type horizInterpReals4_type

!> Holds data pointers and metadata for horizontal interpolations, passed between the horiz_interp modules
!> @ingroup horiz_interp_type_mod
type horiz_interp_type
integer, dimension(:,:), allocatable :: ilon !< indices for conservative scheme
integer, dimension(:,:), allocatable :: jlat !< indices for conservative scheme
!! wti ist used for derivative "weights" in bicubic
integer, dimension(:,:,:), allocatable :: i_lon !< indices for bilinear interpolation
!! and spherical regrid
integer, dimension(:,:,:), allocatable :: j_lat !< indices for bilinear interpolation
!! and spherical regrid
logical, dimension(:,:), allocatable :: found_neighbors !< indicate whether destination grid
!! has some source grid around it.
integer, dimension(:,:), allocatable :: num_found
integer :: nlon_src !< size of source grid
integer :: nlat_src !< size of source grid
integer :: nlon_dst !< size of destination grid
integer :: nlat_dst !< size of destination grid
integer :: interp_method !< interpolation method.
!! =1, conservative scheme
!! =2, bilinear interpolation
!! =3, spherical regrid
!! =4, bicubic regrid
logical :: I_am_initialized=.false.
integer :: version !< indicate conservative
!! interpolation version with value 1 or 2
!--- The following are for conservative interpolation scheme version 2 ( through xgrid)
integer :: nxgrid !< number of exchange grid
!! between src and dst grid.
integer, dimension(:), allocatable :: i_src !< indices in source grid.
integer, dimension(:), allocatable :: j_src !< indices in source grid.
integer, dimension(:), allocatable :: i_dst !< indices in destination grid.
integer, dimension(:), allocatable :: j_dst !< indices in destination grid.
type(horizInterpReals8_type), allocatable :: horizInterpReals8_type !< derived type holding kind 8 real data pointers
!! if compiled with r8_kind
type(horizInterpReals4_type), allocatable :: horizInterpReals4_type !< derived type holding kind 4 real data pointers
!! if compiled with r8_kind

end type

!> @addtogroup horiz_interp_type_mod
!> @{
contains
Expand Down

0 comments on commit 91757f5

Please sign in to comment.