Download Latest Version geomlib.tar.gz (58.3 kB)
Email in envelope

Get an email when there's a new version of CFD Utilities

Home / xyzq_io
Name Modified Size InfoDownloads / Week
Parent folder
README 2023-09-29 3.8 kB
xyzq_io.f90 2023-09-26 38.5 kB
f_io.f90 2016-03-06 3.2 kB
xyq_io.f90 2015-07-30 37.5 kB
Totals: 4 Items   82.9 kB 0
The following module should be used by an applicationn wishing to override the default indexing of flow data as %q(m,i,j,k) that
was adopted in the initial implementation of this Plot3D I/O package.  The source for this module appears at the top of xyzq_io.f90.

   module indexing_choice

   logical, save :: plot3d_order = .false.   ! .false. specifies %q(m,i,j,k) index order (inefficient for Plot3D function file I/O)
                                             ! .true.  specifies %q(i,j,k,m) index order (preferable for efficient I/O)
   end module indexing_choice

Utilities for reading and writing PLOT3D-type multiblock grids and optional
function files (or portions of grids and flow files) are packaged as a
module in xyzq_io.f90 (3-space, as shown below) and xyq_io.f90 (2-space).
See also f_io.f90 for best I/O efficiency on function files.

   public :: file_prompt    ! Prompt for a file name and open the file

   public :: xyzq_read      ! Read a multiblock grid + optional flow soln.
   public :: xyz_write      ! Write a multiblock grid
   public :: q_write        ! Write a flow solution

   public :: xyz_header_io  ! Read or write grid header records
   public :: q_header_io    ! Read or write flow header records
   public :: xyz_allocate   ! Allocate one grid block
   public :: q_allocate     ! Allocate one flow block
   public :: xyz_block_io   ! Read or write one grid block
   public :: q_block_io     ! Read or write one flow block

   public :: xyziq_read     ! "iblank" variants of the xyz utilities above
   public :: xyzi_write
   public :: xyzi_allocate
   public :: xyzi_block_io

Recent addition to xyq_io:

   public :: xyq_2d_to_3d   ! Convert xy(ni,nj) -> xyz(ni,1,nj); y -> 0.

A derived data type is employed as follows, and is extensible.  For
instance, the I/O packages do not reference the data range variables
shown here.  Note that compilation with the -r8 flag or equivalent is
intended.

grid_block_structure.f90:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

   module grid_block_structure

!  Module for a structured grid block with associated flow field variables
!  and optional PLOT3D-type blanking of grid points.
!  The %mi/mj/mk variables were inherited from NASA LaRC, but all applica-
!  tions at NASA ARC have %mi = %ni, etc.

   implicit none

   type grid_type
      real,    dimension(:,:,:),   pointer :: x,y,z  ! Grid coordinates
      real,    dimension(:,:,:,:), pointer :: q      ! Fns. in (1:nf,:,:,:)
                                                     ! or (:,:,:,1:nf)
      integer, dimension(:,:,:),   pointer :: iblank ! 0 => suppress the pt.

      real    :: xmin, xmax        ! Data range for the block in the x dir.
      real    :: ymin, ymax        ! ... and the y direction ...
      real    :: zmin, zmax        ! ... and the z direction

      integer :: ni, nj, nk        ! # grid vertices in i, j, k directions
      integer :: mi, mj, mk        ! # dependent variables in each dir.
   end type grid_type

   end module grid_block_structure

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

04/02/2004   D. A. Saunders   Initial implementation, for grid-morphing use at NASA LaRC (and other CFD utilities).
01/15/2010    "    "    "     After years of regretting the decision to avoid possible machine dependencies with advance='no',
                              the file prompting now leaves the cursor at the end of the prompt.
03/03/2010    "    "    "     Added "iblank" variants of the grid utilities.
09/25/2023    "    "    "     Added function storage choice as explained above.

Author:  David Saunders, ELORET Corporation/NASA Ames Research Center, Moffett Field, CA
         Now with AMA, Inc. at ARC.
Source: README, updated 2023-09-29