43 REAL,
PARAMETER ::
pi = 3.1415926535897932384626433832795028842
52 REAL,
DIMENSION(3) :: geoparam
53 INTEGER,
PRIVATE :: azimuthindex = 0
58 procedure(scalefactors_1),
DEFERRED :: scalefactors_1
59 procedure(scalefactors_2),
DEFERRED :: scalefactors_2
60 procedure(scalefactors_3),
DEFERRED :: scalefactors_3
61 procedure(scalefactors_4),
DEFERRED :: scalefactors_4
63 procedure(radius_1),
DEFERRED :: radius_1
64 procedure(radius_2),
DEFERRED :: radius_2
65 procedure(radius_3),
DEFERRED :: radius_3
66 procedure(radius_4),
DEFERRED :: radius_4
68 procedure(positionvector_1),
DEFERRED :: positionvector_1
69 procedure(positionvector_2),
DEFERRED :: positionvector_2
70 procedure(positionvector_3),
DEFERRED :: positionvector_3
71 procedure(positionvector_4),
DEFERRED :: positionvector_4
73 procedure(convert2cartesian_coords_1),
DEFERRED :: convert2cartesian_coords_1
74 procedure(convert2cartesian_coords_2),
DEFERRED :: convert2cartesian_coords_2
75 procedure(convert2cartesian_coords_3),
DEFERRED :: convert2cartesian_coords_3
76 procedure(convert2cartesian_coords_4),
DEFERRED :: convert2cartesian_coords_4
78 procedure(convert2curvilinear_coords_1),
DEFERRED :: convert2curvilinear_coords_1
79 procedure(convert2curvilinear_coords_2),
DEFERRED :: convert2curvilinear_coords_2
80 procedure(convert2curvilinear_coords_3),
DEFERRED :: convert2curvilinear_coords_3
81 procedure(convert2curvilinear_coords_4),
DEFERRED :: convert2curvilinear_coords_4
83 procedure(convert2cartesian_vectors_1),
DEFERRED :: convert2cartesian_vectors_1
84 procedure(convert2cartesian_vectors_2),
DEFERRED :: convert2cartesian_vectors_2
85 procedure(convert2cartesian_vectors_3),
DEFERRED :: convert2cartesian_vectors_3
86 procedure(convert2cartesian_vectors_4),
DEFERRED :: convert2cartesian_vectors_4
88 procedure(convert2curvilinear_vectors_1),
DEFERRED :: convert2curvilinear_vectors_1
89 procedure(convert2curvilinear_vectors_2),
DEFERRED :: convert2curvilinear_vectors_2
90 procedure(convert2curvilinear_vectors_3),
DEFERRED :: convert2curvilinear_vectors_3
91 procedure(convert2curvilinear_vectors_4),
DEFERRED :: convert2curvilinear_vectors_4
106 generic,
PUBLIC :: scalefactors =>
scalefactors_0, scalefactors_1, scalefactors_2, &
107 scalefactors_3, scalefactors_4
109 generic,
PUBLIC :: radius =>
radius_0, radius_1, radius_2, radius_3, radius_4
111 generic,
PUBLIC :: positionvector =>
positionvector_0, positionvector_1, positionvector_2, &
112 positionvector_3, positionvector_4
115 convert2cartesian_coords_1, convert2cartesian_coords_2,&
116 convert2cartesian_coords_3, convert2cartesian_coords_4, &
117 convert2cartesian_vectors_1, convert2cartesian_vectors_2,&
118 convert2cartesian_vectors_3, convert2cartesian_vectors_4
121 convert2curvilinear_coords_1, convert2curvilinear_coords_2,&
122 convert2curvilinear_coords_3, convert2curvilinear_coords_4,&
123 convert2curvilinear_vectors_1, convert2curvilinear_vectors_2,&
124 convert2curvilinear_vectors_3, convert2curvilinear_vectors_4
130 PURE SUBROUTINE scalefactors_1(this,coords,hx,hy,hz)
134 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
135 REAL,
DIMENSION(:),
INTENT(OUT) :: hx,hy,hz
137 PURE SUBROUTINE scalefactors_2(this,coords,hx,hy,hz)
141 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
142 REAL,
DIMENSION(:,:),
INTENT(OUT) :: hx,hy,hz
144 PURE SUBROUTINE scalefactors_3(this,coords,hx,hy,hz)
148 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
149 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: hx,hy,hz
151 PURE SUBROUTINE scalefactors_4(this,coords,hx,hy,hz)
155 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
156 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: hx,hy,hz
158 PURE SUBROUTINE radius_1(this,coords,r)
162 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
163 REAL,
DIMENSION(:),
INTENT(OUT) :: r
165 PURE SUBROUTINE radius_2(this,coords,r)
169 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
170 REAL,
DIMENSION(:,:),
INTENT(OUT) :: r
172 PURE SUBROUTINE radius_3(this,coords,r)
176 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
177 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: r
179 PURE SUBROUTINE radius_4(this,coords,r)
183 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
184 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: r
186 PURE SUBROUTINE positionvector_1(this,coords,posvec)
190 REAL,
DIMENSION(:,:),
INTENT(IN) :: coords
191 REAL,
DIMENSION(:,:),
INTENT(OUT) :: posvec
193 PURE SUBROUTINE positionvector_2(this,coords,posvec)
197 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: coords
198 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: posvec
200 PURE SUBROUTINE positionvector_3(this,coords,posvec)
204 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: coords
205 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: posvec
207 PURE SUBROUTINE positionvector_4(this,coords,posvec)
211 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: coords
212 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: posvec
214 PURE SUBROUTINE convert2cartesian_coords_1(this,curv,cart)
218 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
219 REAL,
DIMENSION(:,:),
INTENT(OUT) :: cart
221 PURE SUBROUTINE convert2cartesian_coords_2(this,curv,cart)
225 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
226 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: cart
228 PURE SUBROUTINE convert2cartesian_coords_3(this,curv,cart)
232 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
233 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: cart
235 PURE SUBROUTINE convert2cartesian_coords_4(this,curv,cart)
239 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
240 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: cart
242 PURE SUBROUTINE convert2curvilinear_coords_1(this,cart,curv)
246 REAL,
DIMENSION(:,:),
INTENT(IN) :: cart
247 REAL,
DIMENSION(:,:),
INTENT(OUT) :: curv
249 PURE SUBROUTINE convert2curvilinear_coords_2(this,cart,curv)
253 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: cart
254 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: curv
256 PURE SUBROUTINE convert2curvilinear_coords_3(this,cart,curv)
260 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: cart
261 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: curv
263 PURE SUBROUTINE convert2curvilinear_coords_4(this,cart,curv)
267 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: cart
268 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: curv
270 PURE SUBROUTINE convert2cartesian_vectors_1(this,curv,v_curv,v_cart)
274 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
275 REAL,
DIMENSION(:,:),
INTENT(IN) :: v_curv
276 REAL,
DIMENSION(:,:),
INTENT(OUT) :: v_cart
278 PURE SUBROUTINE convert2cartesian_vectors_2(this,curv,v_curv,v_cart)
282 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
283 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: v_curv
284 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: v_cart
286 PURE SUBROUTINE convert2cartesian_vectors_3(this,curv,v_curv,v_cart)
290 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
291 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: v_curv
292 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: v_cart
294 PURE SUBROUTINE convert2cartesian_vectors_4(this,curv,v_curv,v_cart)
298 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
299 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: v_curv
300 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: v_cart
302 PURE SUBROUTINE convert2curvilinear_vectors_1(this,curv,v_cart,v_curv)
306 REAL,
DIMENSION(:,:),
INTENT(IN) :: curv
307 REAL,
DIMENSION(:,:),
INTENT(IN) :: v_cart
308 REAL,
DIMENSION(:,:),
INTENT(OUT) :: v_curv
310 PURE SUBROUTINE convert2curvilinear_vectors_2(this,curv,v_cart,v_curv)
314 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: curv
315 REAL,
DIMENSION(:,:,:),
INTENT(IN) :: v_cart
316 REAL,
DIMENSION(:,:,:),
INTENT(OUT) :: v_curv
318 PURE SUBROUTINE convert2curvilinear_vectors_3(this,curv,v_cart,v_curv)
322 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: curv
323 REAL,
DIMENSION(:,:,:,:),
INTENT(IN) :: v_cart
324 REAL,
DIMENSION(:,:,:,:),
INTENT(OUT) :: v_curv
326 PURE SUBROUTINE convert2curvilinear_vectors_4(this,curv,v_cart,v_curv)
330 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: curv
331 REAL,
DIMENSION(:,:,:,:,:),
INTENT(IN) :: v_cart
332 REAL,
DIMENSION(:,:,:,:,:),
INTENT(OUT) :: v_curv
385 CHARACTER(LEN=*) :: gname
386 REAL :: gs_def,gs_def2,gs_def3
388 CHARACTER(LEN=8) :: gs_str
390 INTENT(IN) :: gnum,gname
392 CALL this%logging_base%InitLogging(gnum,gname)
394 CALL getattr(config,
"geometry", gt)
407 CALL getattr(config,
"gparam", gs_def, 1.0)
423 CALL this%Info(
" GEOMETRY-> coordinates: " // trim(this%GetName()))
426 WRITE (gs_str,
'(ES8.1)') this%GetScale()
427 CALL this%Info(
" geometry scale: " // trim(gs_str))
445 gp =
this%geoparam(1)
452 INTEGER,
INTENT(IN) :: i
455 gp =
this%geoparam(i)
462 REAL,
INTENT(IN) :: gp
464 this%geoparam(1) = gp
471 REAL,
INTENT(IN) :: gp,gp2
473 this%geoparam(1) = gp
474 this%geoparam(2) = gp2
481 REAL,
INTENT(IN) :: gp,gp2,gp3
483 this%geoparam(1) = gp
484 this%geoparam(2) = gp2
485 this%geoparam(3) = gp3
506 CALL this%ScaleFactors(coords%data2d(:,:),hx%data1d(:),hy%data1d(:),hz%data1d(:))
522 CALL this%Radius(coords%data2d(:,:),radius%data1d(:))
538 CALL this%PositionVector(coords%data2d(:,:),posvec%data2d(:,:))
552 CALL this%Convert2Cartesian(curv%data2d(:,:),cart%data2d(:,:))
566 CALL this%Convert2Curvilinear(cart%data2d(:,:),curv%data2d(:,:))
581 CALL this%Convert2Cartesian(curv%data2d(:,:),v_curv%data2d(:,:),v_cart%data2d(:,:))
594 CALL this%Convert2Curvilinear(curv%data2d(:,:),v_cart%data2d(:,:),v_curv%data2d(:,:))
604 INTEGER,
INTENT(IN) :: idx
606 this%azimuthIndex = idx
618 idx =
this%azimuthIndex
627 IF (.NOT.this%Initialized()) &
628 CALL this%Error(
"CloseGeometry",
"not initialized")
Dictionary for generic data types.
type(logging_base), save this
base class for geometrical properties
pure integer function getazimuthindex(this)
returns the coordinate index of the azimuthal angle
real, parameter, public pi
integer, parameter, public spherical
pure subroutine convert2cartesian_vectors(this, curv, v_curv, v_cart)
Convert curvilinear vector components to cartesian vector components.
integer, parameter, public tancylindrical
pure subroutine positionvector_0(this, coords, posvec)
compute position vector components for all cell positions
integer, parameter, public cartesian
integer, parameter, public cylindrical
subroutine finalize_base(this)
Destructor of generic geometry module.
integer, parameter, public logcylindrical
subroutine initgeometry(this, gnum, gname, config)
Constructor of generic geometry module.
pure subroutine setscale2(this, gp, gp2)
pure subroutine scalefactors_0(this, coords, hx, hy, hz)
Compute scale factors.
pure subroutine radius_0(this, coords, radius)
Compute radial distances to the origin.
pure subroutine convert2curvilinear_coords(this, cart, curv)
Convert cartesian to curvilinear coordinates.
pure real function getscale2(this, i)
integer, parameter, public spherical_planet
pure subroutine convert2curvilinear_vectors(this, curv, v_cart, v_curv)
Convert cartesian vector components to curvilinear vector components.
pure subroutine convert2cartesian_coords(this, curv, cart)
Convert curvilinear to cartesian coordinates.
integer, parameter, public logspherical
pure real function getscale1(this)
pure subroutine setazimuthindex(this, idx)
sets the coordinate index of the azimuthal angle
pure subroutine setscale1(this, gp)
pure subroutine setscale3(this, gp, gp2, gp3)
subroutine finalize(this)
Destructor of logging_base class.
derived mesh array class for scalar cell data
derived mesh array class for vector cell data