ITM Grid Service Library: Fortran 90
|
00001 module itm_limiter_mockup 00002 00003 ! Mockup for limiter data structure 00004 00005 use euITM_utilities 00006 use itm_types 00007 00008 implicit none 00009 00010 type type_limgeometry ! 00011 integer,pointer :: npoints(:,:) => null() ! /limgeometry/npoints - Number of points describing an element (irregular outline rzcoordinates); Matrix (nlims,max_nelements) 00012 integer,pointer :: closed(:,:) ! /limgeometry/closed - Flag indicating whether a structure is closed (i.e. the last and first point are to be connected); closed(:,:) = 0 means open, closed(:,:) = 1 means closed. Matrix (nlims,max_nelements) 00013 type (type_rz3D) :: rzcoordinate ! /limgeometry/rzcoordinate - Irregular outline [m]; 3D arrays (nlims,max_nelements,max_npoints) 00014 endtype type_limgeometry 00015 00016 type type_limelement ! 00017 character(len=132), dimension(:), pointer ::name => null() ! /limelement/name - Name of this element. Should be a matrix of strings (nlims,max_nelements), but not supported by the UAL yet. 00018 !character(len=132), dimension(:), pointer ::id => null() ! /limelement/id - ID of this element. Should be a matrix of strings (nlims,max_nelements), but not supported by the UAL yet. 00019 type (type_limgeometry) :: limgeometry ! /limelement/limgeometry - 00020 endtype type_limelement 00021 00022 integer, parameter :: ITM_STRUCT_OPEN = 0 00023 integer, parameter :: ITM_STRUCT_CLOSED = 1 00024 00025 00026 contains 00027 00028 00029 subroutine itmlimReadFromStructureFile(filename, limiter) 00030 character(*), intent(in) :: filename 00031 type(type_limelement), intent(inout) :: limiter 00032 00033 ! internal 00034 00035 integer, parameter :: nstrmx = 100 ! max. number of structures 00036 integer, parameter :: npstmx = 200 ! max. number of points per structure 00037 00038 integer :: nstruc,npstru(nstrmx) 00039 real*8 :: xstruc(npstmx,nstrmx),ystruc(npstmx,nstrmx) 00040 character nomstr(nstrmx)*80 00041 00042 integer :: is 00043 00044 ! open & read structure file 00045 OPEN(UNIT=8, FILE=filename, STATUS='old') 00046 nstruc=0 00047 call listru(8,nstruc,npstru,nomstr,xstruc,ystruc,npstmx,nstrmx) 00048 ! ... file is closed in listru 00049 00050 ! transfer to CPO structure 00051 allocate( limiter % name( nstruc ) ) 00052 allocate( limiter % limgeometry % npoints( nstruc, 1 ) ) 00053 allocate( limiter % limgeometry % closed( nstruc, 1 ) ) 00054 allocate( limiter % limgeometry % rzcoordinate % r( nstruc, 1, maxval( npstru ) ) ) 00055 allocate( limiter % limgeometry % rzcoordinate % z( nstruc, 1, maxval( npstru ) ) ) 00056 00057 00058 limiter % limgeometry % closed = ITM_STRUCT_OPEN 00059 do is = 1, nstruc 00060 00061 limiter % name( is ) = nomstr( is ) 00062 limiter % limgeometry % npoints( is, 1 ) = abs( npstru( is ) ) 00063 if ( npstru( is ) < 0 ) then 00064 limiter % limgeometry % closed( is, 1 ) = ITM_STRUCT_CLOSED 00065 end if 00066 limiter % limgeometry % rzcoordinate % r( is, 1, 1 : abs(npstru( is )) ) & 00067 & = xstruc(:,is) 00068 limiter % limgeometry % rzcoordinate % z( is, 1, 1 : abs(npstru( is )) ) & 00069 & = ystruc(:,is) 00070 00071 end do 00072 00073 end subroutine itmlimReadFromStructureFile 00074 00075 00076 00077 end module itm_limiter_mockup