25 integer,
parameter,
public ::
dp = selected_real_kind(14,100)
26 integer,
parameter,
public ::
sp = selected_real_kind(6,30)
40 TYPE(c_ptr) :: classid
42 TYPE(c_ptr) :: elementname
87 subroutine addelement( eq_elements, eq_element )
89 TYPE(
eqelement),
pointer :: eq_elements(:)
90 TYPE(
eqelement),
pointer :: eq_elements_new(:)
95 if (.not.
ASSOCIATED(eq_elements))
then 96 allocate(eq_elements(1))
97 eq_elements(1) = eq_element
101 elementnum =
SIZE( eq_elements, 1)
102 allocate( eq_elements_new(elementnum+1) )
104 do idx = 1, elementnum
105 eq_elements_new(idx) = eq_elements(idx)
108 eq_elements_new(elementnum+1) = eq_element
110 deallocate( eq_elements )
111 allocate( eq_elements(elementnum+1) )
112 do idx = 1, elementnum+1
113 eq_elements(idx) = eq_elements_new(idx)
116 deallocate( eq_elements_new )
133 allocate( eq_elements(num) )
136 eq_elements(idx)%elementname = c_loc( null() )
137 eq_elements(idx)%dim = c_loc( null() )
138 eq_elements(idx)%dims = c_loc( null() )
139 eq_elements(idx)%value = c_loc( null() )
140 eq_elements(idx)%classID = c_loc( null() )
155 allocate( eq_element )
157 eq_element%elementname = c_loc( null() )
158 eq_element%dim = c_loc( null() )
159 eq_element%dims = c_loc( null() )
160 eq_element%value = c_loc( null() )
161 eq_element%classID = c_loc( null() )
174 byte,
pointer :: ptr => null()
176 call c_f_pointer( eq_element%elementname, ptr )
177 if (
ASSOCIATED(ptr))
then 182 call c_f_pointer( eq_element%dim, ptr )
183 if (
ASSOCIATED(ptr))
then 188 call c_f_pointer( eq_element%dims, ptr )
189 if (
ASSOCIATED(ptr))
then 194 call c_f_pointer( eq_element%value, ptr )
195 if (
ASSOCIATED(ptr))
then 200 call c_f_pointer( eq_element%classID, ptr )
201 if (
ASSOCIATED(ptr))
then 220 character(len=*) :: elementname
221 character(len(elementname)+1),
pointer :: pelementname
223 integer,
pointer :: dims(:)
224 integer,
pointer :: dim(:)
225 integer,
pointer :: classID(:)
227 allocate( dims(1), stat=iostat)
230 allocate( dim(1), stat=iostat)
232 allocate( classid(1), stat=iostat)
236 allocate(pelementname)
237 pelementname = trim(elementname)//c_null_char
239 eq_element%elementname = c_loc(pelementname)
240 eq_element%dim = c_loc(dim(1))
241 eq_element%dims = c_loc( dims(1) )
242 eq_element%value = c_loc(
value)
243 eq_element%classID = c_loc(classid(1))
258 character(len=*) :: elementname
259 character(len(elementname)+1),
pointer :: pelementname
260 character(len=*),
pointer ::
value(:)
261 TYPE(c_ptr),
pointer :: values(:)
262 integer,
pointer :: dims(:)
263 integer,
pointer :: dim(:)
264 integer,
pointer :: classID(:)
267 allocate( dims(1), stat=iostat)
268 dims(1) =
SIZE(
value,1)
270 allocate( dim(1), stat=iostat)
272 allocate( classid(1), stat=iostat)
275 allocate(values( dims(1) ))
277 value(idx) = trim(value(idx))//c_null_char
278 values(idx) = c_loc( value(idx) )
281 allocate(pelementname)
282 pelementname = trim(elementname)//c_null_char
284 eq_element%elementname = c_loc(pelementname)
285 eq_element%dim = c_loc(dim(1))
286 eq_element%dims = c_loc( dims(1) )
287 eq_element%value = c_loc( values(1) )
288 eq_element%classID = c_loc(classid(1))
305 character(len=*) :: elementname
306 character(len(elementname)+1),
pointer :: pelementname
307 character(len=*) :: value
308 character(len(trim(value))+1),
pointer :: value_tmp
309 TYPE(c_ptr),
pointer :: values(:)
310 integer,
pointer :: dims(:)
311 integer,
pointer :: dim(:)
312 integer,
pointer :: classID(:)
315 allocate( dims(1), stat=iostat)
318 allocate( dim(1), stat=iostat)
320 allocate( classid(1), stat=iostat)
325 value_tmp = trim(
value)//c_null_char
326 values(1) = c_loc(value_tmp)
328 allocate(pelementname)
329 pelementname = trim(elementname)//c_null_char
331 eq_element%elementname = c_loc(pelementname)
332 eq_element%dim = c_loc(dim(1))
333 eq_element%dims = c_loc( dims(1) )
334 eq_element%value = c_loc( values(1) )
335 eq_element%classID = c_loc(classid(1))
351 character(len=*) :: elementname
352 character(len(elementname)+1),
pointer :: pelementname
354 integer,
pointer :: pvalue(:)
355 integer,
pointer :: dims(:)
356 integer,
pointer :: dim(:)
357 integer,
pointer :: classID(:)
359 allocate( dims(1), stat=iostat)
362 allocate( pvalue(1), stat=iostat)
363 if (
value.eqv..true.)
then 369 allocate( dim(1), stat=iostat)
371 allocate( classid(1), stat=iostat)
374 allocate(pelementname)
375 pelementname = trim(elementname)//c_null_char
377 eq_element%elementname = c_loc(pelementname)
378 eq_element%dim = c_loc(dim(1))
379 eq_element%dims = c_loc( dims(1) )
380 eq_element%value = c_loc(pvalue(1))
381 eq_element%classID = c_loc(classid(1))
397 character(len=*) :: elementname
398 character(len(elementname)+1),
pointer :: pelementname
400 integer,
pointer :: pvalue(:)
401 integer,
pointer :: dims(:)
402 integer,
pointer :: dim(:)
403 integer,
pointer :: classID(:)
406 allocate( dims(1), stat=iostat)
409 allocate(pvalue(1), stat=iostat)
412 allocate( dim(1), stat=iostat)
414 allocate( classid(1), stat=iostat)
417 allocate(pelementname)
418 pelementname = trim(elementname)//c_null_char
420 eq_element%elementname = c_loc(pelementname)
421 eq_element%dim = c_loc(dim(1))
422 eq_element%dims = c_loc( dims(1) )
423 eq_element%value = c_loc(pvalue(1))
424 eq_element%classID = c_loc(classid(1))
440 character(len=*) :: elementname
441 character(len(elementname)+1),
pointer :: pelementname
443 real(dp),
pointer :: pvalue
444 integer,
pointer :: dims(:)
445 integer,
pointer :: dim(:)
446 integer,
pointer :: classID(:)
448 allocate( dims(1), stat=iostat)
451 allocate(pvalue, stat=iostat)
454 allocate( dim(1), stat=iostat)
456 allocate( classid(1), stat=iostat)
460 print *,
'Undetermined real type !!!!!!!!!!!' 464 allocate(pelementname)
465 pelementname = trim(elementname)//c_null_char
467 eq_element%elementname = c_loc(pelementname)
468 eq_element%dim = c_loc(dim(1))
469 eq_element%dims = c_loc( dims(1) )
470 eq_element%value = c_loc(pvalue)
471 eq_element%classID = c_loc(classid(1))
488 character(len=*) :: elementname
489 character(len(elementname)+1),
pointer :: pelementname
490 integer,
pointer ::
value(:)
491 integer,
pointer :: dims(:)
492 integer,
pointer :: dim(:)
493 integer,
pointer :: classID(:)
496 allocate( dims(1), stat=iostat)
497 dims(1) =
SIZE(
value, 1)
499 allocate( dim(1), stat=iostat)
501 allocate( classid(1), stat=iostat)
505 allocate(pelementname)
506 pelementname = trim(elementname)//c_null_char
508 eq_element%elementname = c_loc(pelementname)
509 eq_element%dim = c_loc(dim(1))
510 eq_element%dims = c_loc( dims(1) )
511 eq_element%value = c_loc(value(1))
512 eq_element%classID = c_loc(classid(1))
528 character(len=*) :: elementname
529 character(len(elementname)+1),
pointer :: pelementname
530 integer,
pointer ::
value(:,:)
531 integer,
pointer :: dims(:)
532 integer,
pointer :: dim(:)
533 integer,
pointer :: classID(:)
535 allocate( dims(2), stat=iostat)
536 dims(1) =
SIZE(
value, 1)
537 dims(2) =
SIZE(
value, 2)
539 allocate( dim(1), stat=iostat)
541 allocate( classid(1), stat=iostat)
544 allocate(pelementname)
545 pelementname = trim(elementname)//c_null_char
547 eq_element%elementname = c_loc(pelementname)
548 eq_element%dim = c_loc(dim(1))
549 eq_element%dims = c_loc( dims(1) )
550 eq_element%value = c_loc(value(1,1))
551 eq_element%classID = c_loc(classid(1))
567 character(len=*) :: elementname
568 character(len(elementname)+1),
pointer :: pelementname
569 real(dp),
pointer ::
value(:)
570 integer,
pointer :: dims(:)
571 integer,
pointer :: dim(:)
572 integer,
pointer :: classID(:)
574 allocate( dims(1), stat=iostat)
575 dims(1) =
SIZE(
value, 1)
577 allocate( dim(1), stat=iostat)
579 allocate( classid(1), stat=iostat)
583 print *,
'Undetermined real type !!!!!!!!!!!' 588 allocate(pelementname)
589 pelementname = trim(elementname)//c_null_char
591 eq_element%elementname = c_loc(pelementname)
592 eq_element%dim = c_loc(dim(1))
593 eq_element%dims = c_loc( dims(1) )
594 eq_element%value = c_loc(value(1))
595 eq_element%classID = c_loc(classid(1))
612 character(len=*) :: elementname
613 character(len(elementname)+1),
pointer :: pelementname
614 real(dp),
pointer ::
value(:,:)
615 integer,
pointer :: dims(:)
616 integer,
pointer :: dim(:)
617 integer,
pointer :: classID(:)
619 allocate( dims(2), stat=iostat)
621 dims(1) =
SIZE(
value, 1)
622 dims(2) =
SIZE(
value, 2)
624 allocate( dim(1), stat=iostat)
626 allocate( classid(1), stat=iostat)
630 print *,
'Undetermined real type !!!!!!!!!!!' 634 allocate(pelementname)
635 pelementname = trim(elementname)//c_null_char
637 eq_element%elementname = c_loc(pelementname)
638 eq_element%dim = c_loc(dim(1))
639 eq_element%dims = c_loc( dims(1) )
640 eq_element%value = c_loc(value(1,1))
641 eq_element%classID = c_loc(classid(1))
subroutine associntmatrixelement(eq_element, elementname, value)
subroutine assocstringelement2(eq_element, elementname, value)
subroutine associntelement(eq_element, elementname, value)
subroutine assoclogicalelement(eq_element, elementname, value)
subroutine assocrealmatrixelement(eq_element, elementname, value)
subroutine deallocateelement(eq_element)
subroutine assocstructelement(eq_element, elementname, value)
subroutine assocrealelement(eq_element, elementname, value)
integer, parameter, public sp
subroutine allocateelementsingle(eq_element)
subroutine assocstringelement(eq_element, elementname, value)
subroutine associntvectorelement(eq_element, elementname, value)
subroutine addelement(eq_elements, eq_element)
subroutine allocateelementarray(eq_elements, num)
subroutine assocrealvectorelement(eq_element, elementname, value)
integer, parameter, public dp