32 #define LISTED_TYPE qg_geom_iter 35 #include "oops/util/linkedList_i.f" 45 #include "oops/util/linkedList_c.f" 49 subroutine c_qg_geo_iter_setup(c_key_self, c_key_geom, c_index) bind(c,name='qg_geo_iter_setup_f90')
51 integer(c_int),
intent(inout) :: c_key_self
52 integer(c_int),
intent(in) :: c_key_geom
53 integer(c_int),
intent(in) :: c_index
55 type(qg_geom_iter),
pointer :: self
56 type(qg_geom),
pointer :: geom
65 self%ilat = (c_index-1)/geom%nx + 1
66 self%ilon = c_index - (self%ilat-1)*geom%nx
72 subroutine c_qg_geo_iter_clone(c_key_self, c_key_other) bind(c,name='qg_geo_iter_clone_f90')
74 integer(c_int),
intent(inout) :: c_key_self
75 integer(c_int),
intent(in) :: c_key_other
77 type(qg_geom_iter),
pointer :: self, other
85 self%geom => other%geom
86 self%ilon = other%ilon
87 self%ilat = other%ilat
95 integer(c_int),
intent(inout) :: c_key_self
103 subroutine c_qg_geo_iter_equals(c_key_self, c_key_other, c_equals) bind(c,name='qg_geo_iter_equals_f90')
105 integer(c_int),
intent(inout) :: c_key_self
106 integer(c_int),
intent(in) :: c_key_other
107 integer(c_int),
intent(inout) :: c_equals
109 type(qg_geom_iter),
pointer :: self, other
115 if (
associated(self%geom, other%geom) .and. &
116 (self%ilon == other%ilon) .and. (self%ilat == other%ilat))
then 126 integer(c_int),
intent(in ) :: c_key_self
127 real(c_double),
intent(inout) :: c_lat
128 real(c_double),
intent(inout) :: c_lon
129 type(qg_geom_iter),
pointer :: self
133 if (self%ilon*self%ilat > self%geom%nx * self%geom%ny)
then 134 print *,
'qg_geo_iter_current: iterator out of bounds' 138 c_lon = self%geom%lon(self%ilon)
139 c_lat = self%geom%lat(self%ilat)
147 integer(c_int),
intent(in ) :: c_key_self
148 type(qg_geom_iter),
pointer :: self
152 if (self%ilon == self%geom%nx)
then 153 self%ilon = 1; self%ilat = self%ilat + 1
155 self%ilon = self%ilon + 1
Fortran module handling geometry iterator for the QG model.
subroutine c_qg_geo_iter_clone(c_key_self, c_key_other)
Fortran derived type to hold geometry data for the QG model.
Fortran derived type to hold geom_iteretry data for the QG model.
type(registry_t), public qg_geom_registry
Linked list interface - defines registry_t type.
subroutine c_qg_geo_iter_next(c_key_self)
subroutine c_qg_geo_iter_equals(c_key_self, c_key_other, c_equals)
Fortran module handling geometry for the QG model.
type(registry_t), public qg_geom_iter_registry
Linked list interface - defines registry_t type.
subroutine c_qg_geo_iter_current(c_key_self, c_lat, c_lon)
subroutine c_qg_geo_iter_setup(c_key_self, c_key_geom, c_index)
Linked list implementation.
subroutine c_qg_geo_iter_delete(c_key_self)