XBeach
C:/repositories/XBeach/trunk/src/xbeachlibrary/mnemonic.F90
Go to the documentation of this file.
00001 module mnemmodule
00002    use typesandkinds, only: slen
00003    implicit none
00004    private
00005    save
00006    public numvars, arraytype, mnemonics, maxnamelen, maxrank, chartoindex, printvar
00007 
00008    include 'mnemonic.inc'
00009 
00010    type arraytype
00011 
00012       character type         ! 'i' or 'r': integer or real*8
00013       character btype        ! 'b' or 'd': broadcast or distribute
00014       integer rank           ! 0,1,2,3,4
00015       character(maxnamelen) :: name     ! 'v','ve', .....
00016       character(slen)       :: units     ! m, following udunits convention
00017       character(slen)       :: standardname
00018       character(slen)       :: description
00019       character(slen), dimension(maxrank) :: dimensions ! the dimensions of the variable, for example (s%nx, s%ny)
00020 
00021       real*8, pointer             :: r0  ! pointer to real8 scalar
00022       real*8, dimension(:), pointer :: r1  ! pointer to real8 (:)
00023       real*8, dimension(:,:), pointer :: r2  ! pointer to real8 (:,:)
00024       real*8, dimension(:,:,:), pointer :: r3  ! pointer to real8 (:,:,:)
00025       real*8, dimension(:,:,:,:), pointer :: r4  ! pointer to real8 (:,:,:,:)
00026 
00027       integer, pointer             :: i0  ! pointer to integer scalar
00028       integer, dimension(:), pointer :: i1  ! pointer to integer (:)
00029       integer, dimension(:,:), pointer :: i2  ! pointer to integer (:,:)
00030       integer, dimension(:,:,:), pointer :: i3  ! pointer to integer (:,:,:)
00031       integer, dimension(:,:,:,:), pointer :: i4  ! pointer to integer (:,:,:,:)
00032 
00033    end type arraytype
00034 
00035 contains
00036 
00037    integer function chartoindex(line)
00038       use logging_module, only: writelog
00039       implicit none
00040 
00041       character(len=*), intent(in)  :: line
00042 
00043       chartoindex = -1
00044 
00045       include 'chartoindex.inc'
00046       if (chartoindex == -1) then
00047          call writelog('sl','','Could not find index for: ', line)
00048       end if
00049    end function chartoindex
00050 
00051    subroutine printvar(t,lid,eid,wid)
00052       type (arraytype) :: t
00053       integer, intent(in) :: lid,eid, wid
00054 
00055       write(*,*)'Name:    ',trim(t%name)
00056       write(*,*)'Type:    ',t%type
00057       write(*,*)'Btype:   ',t%btype
00058       write(*,*)'Rank:    ',t%rank
00059 
00060       write(lid,*)'Name:    ',trim(t%name)
00061       write(lid,*)'Type:    ',t%type
00062       write(lid,*)'Btype:   ',t%btype
00063       write(lid,*)'Rank:    ',t%rank
00064 
00065       write(eid,*)'Name:    ',trim(t%name)
00066       write(eid,*)'Type:    ',t%type
00067       write(eid,*)'Btype:   ',t%btype
00068       write(eid,*)'Rank:    ',t%rank
00069 
00070       write(wid,*)'Name:    ',trim(t%name)
00071       write(wid,*)'Type:    ',t%type
00072       write(wid,*)'Btype:   ',t%btype
00073       write(wid,*)'Rank:    ',t%rank
00074 
00075    end subroutine printvar
00076 end module mnemmodule
 All Classes Files Functions Variables Defines