ensight_variables.F [SRC] [CPP] [JOB] [SCAN]
TOOLS / EXTERNAL



   1 | include(dom.inc)
   2 | !     ===============================================================
   3 | !     Copyright (c) CERFACS (all rights reserved)
   4 | !     ===============================================================
   5 | 
   6 | !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   7 | !
   8 | !     module: ensight_variables.f
   9 | ! 
  10 | !     author: Andre Kaufmann, 14.08.2000
  11 | !
  12 | !     last change: J. Amaya, O. Cabrit, A. Roux - 11/2006
  13 | !     ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  14 |       module ensight_variables
  15 |       use avbp_coor
  16 |       implicit none
  17 |       DOM_INT  ensight_nscalars,                                        &
  18 |      &         ensight_nvectors,                                        &
  19 |      &         ensight_nnode,                                           &
  20 |      &         ensight_nrec,                                            &
  21 |      &         ensight_fictives,                                        &
  22 |      &         ensight_vectordims
  23 |       character*80,dimension(:),allocatable :: ensight_scal_name,       &
  24 |      &                                         ensight_scal_type,       &
  25 |      &                                         ensight_vec_name,        &
  26 |      &                                         ensight_vec_type
  27 |       character*240,dimension(:),allocatable:: ensight_scal_fn,         &
  28 |      &                                         ensight_vec_fn
  29 |       real*4,  dimension(:,:), allocatable  :: ensight_scalars,         &
  30 |      &                                         ensight_vectors,         &
  31 |      &                                         ensight_minmax_scalar,   &
  32 |      &                                         ensight_minmax_vector
  33 |       real*4,  dimension(:),   allocatable  :: ensight_time
  34 |       DOM_INT, dimension(:),   allocatable  :: ensight_iter
  35 |       logical, parameter ::  ensight_variables_debug = .false.
  36 |       logical  ensight_overwrite
  37 |       contains
  38 | !     =================================================================
  39 | !
  40 | !     create space for vector info
  41 | !
  42 | !     =================================================================
  43 |       subroutine create_ensight_info
  44 |         implicit none
  45 |         allocate(ensight_scal_name(1:ensight_nscalars))
  46 |         allocate(ensight_vec_name(1:ensight_nvectors))
  47 |         allocate(ensight_scal_type(1:ensight_nscalars))
  48 |         allocate(ensight_vec_type(1:ensight_nvectors))
  49 |         allocate(ensight_scal_fn(1:ensight_nscalars))
  50 |         allocate(ensight_vec_fn(1:ensight_nvectors))
  51 |       end subroutine create_ensight_info      
  52 | !     =================================================================
  53 | !
  54 | !
  55 | !     =================================================================
  56 |       subroutine create_ensight_steprec
  57 |         allocate(ensight_time(1:ensight_nrec))
  58 |         allocate(ensight_iter(1:ensight_nrec))
  59 |       endsubroutine create_ensight_steprec
  60 | !     =================================================================
  61 | !
  62 | !     create variables
  63 | !
  64 | !     =================================================================
  65 |       subroutine create_ensight_variables
  66 |         implicit none
  67 |         DOM_INT  maxentries,i
  68 |         DOM_INT n
  69 | !
  70 | !     check for allocation
  71 | !
  72 |         if(ensight_variables_debug) call checkensightvariables
  73 |  
  74 |          maxentries = ensight_vectordims
  75 | 
  76 |         if(allocated(ensight_scalars)) then
  77 |            deallocate(ensight_scalars)
  78 |         endif
  79 |         
  80 |         if(allocated(ensight_vectors)) then
  81 |            deallocate(ensight_vectors)
  82 |         endif
  83 | 
  84 |         if(allocated(ensight_minmax_scalar)) then
  85 |            deallocate(ensight_minmax_scalar)
  86 |         endif
  87 | 
  88 |         if(allocated(ensight_minmax_vector)) then
  89 |            deallocate(ensight_minmax_vector)
  90 |         endif
  91 | 
  92 | 
  93 |         allocate(ensight_scalars(1:ensight_nscalars,                    &
  94 |      &                           1:ensight_nnode))
  95 |         allocate(ensight_vectors(1:ensight_nvectors,                    &
  96 |      &                           1:maxentries*ensight_nnode))
  97 |         allocate(ensight_minmax_scalar(1:ensight_nscalars,1:2))
  98 |         allocate(ensight_minmax_vector(1:ensight_nvectors,              &
  99 |      &                                 1:2*maxentries))
 100 | 
 101 |       end subroutine create_ensight_variables
 102 | !     =================================================================
 103 | !
 104 | !     deallocate variables
 105 | !
 106 | !     =================================================================
 107 |       subroutine destroyensightvariables
 108 |         implicit none
 109 |         if(allocated(ensight_scalars))                                  &
 110 |      &        deallocate(ensight_scalars)
 111 |         if(allocated(ensight_vectors))                                  &
 112 |      &        deallocate(ensight_vectors)
 113 |         if(allocated(ensight_minmax_scalar))                            &
 114 |      &        deallocate(ensight_minmax_scalar)
 115 |         if(allocated(ensight_minmax_vector))                            &
 116 |      &        deallocate(ensight_minmax_vector)
 117 |         if(allocated(ensight_scal_name))                                &
 118 |      &        deallocate(ensight_scal_name)
 119 |         if(allocated(ensight_vec_name))                                 &
 120 |      &        deallocate(ensight_vec_name)
 121 |         if(allocated(ensight_scal_type))                                &
 122 |      &        deallocate(ensight_scal_type)
 123 |         if(allocated(ensight_vec_type))                                 &
 124 |      &        deallocate(ensight_vec_type)
 125 |         if(allocated(ensight_time))                                     &
 126 |      &        deallocate(ensight_time)
 127 |         if(allocated(ensight_iter))                                     &
 128 |      &        deallocate(ensight_iter)
 129 |       end subroutine destroyensightvariables
 130 | !     =================================================================
 131 | !
 132 | !     check variable allocation
 133 | !
 134 | !     =================================================================
 135 |       subroutine checkensightvariables
 136 |         implicit none
 137 |         if(allocated(ensight_scalars))                                  &
 138 |      &        write(*,*) 'ensight_scalars allocated '
 139 |         if(allocated(ensight_vectors))                                  &
 140 |      &        write(*,*) 'ensight_vecotrs allocated '
 141 |         if(allocated(ensight_minmax_scalar))                            &
 142 |      &        write(*,*) 'ensight_minmax_scalar allocated '
 143 |         if(allocated(ensight_minmax_vector))                            &
 144 |      &        write(*,*) 'ensight_minmax_vector allocated '
 145 |         if(allocated(ensight_scal_name))                                &
 146 |      &        write(*,*) 'ensight_scal_name allocated '
 147 |         if(allocated(ensight_vec_name))                                 &
 148 |      &        write(*,*) 'ensight_vec_name allocated '
 149 |         if(allocated(ensight_scal_type))                                &
 150 |      &        write(*,*) 'ensight_scal_type allocated '
 151 |         if(allocated(ensight_vec_type))                                 &
 152 |      &        write(*,*) 'ensight_vec_type allocated '
 153 |         if(allocated(ensight_time))                                     &
 154 |      &        write(*,*) 'ensight_time allocated '
 155 |         if(allocated(ensight_iter))                                     &
 156 |      &        write(*,*) 'ensight_iter allocated '
 157 |       end subroutine checkensightvariables
 158 |       end module ensight_variables
 159 |