source: CIVL/mods/dev.civl.abc/examples/fortran/flash/block/Eos_wrapped_blkid.F90

main
Last change on this file was aad342c, checked in by Stephen Siegel <siegel@…>, 3 years ago

Performing huge refactor to incorporate ABC, GMC, and SARL into CIVL repo and use Java modules.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5664 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 4.6 KB
Line 
1!!****if* source/physics/Eos/EosMain/Eos_wrapped_blkid
2!! NAME
3!!
4!! Eos_wrapped_blkid
5!!
6!! SYNOPSIS
7!!
8!! call Eos_wrapped_blkid( integer(IN) :: mode,
9!! integer(IN) :: range(HIGH, MDIM),
10!! integer(IN) :: blockID,
11!! optional,integer(IN) :: gridDataStruct )
12!!
13!! DESCRIPTION
14!!
15!! This function is provided for the user's convenience and acts as a simple
16!! wrapper to the Eos interface. The Eos interface uses a single, flexible data
17!! structure "eosData" to pass the thermodynamic quantities in and out of the
18!! funtion (see Eos). The wrapper hides formation and use of eosData
19!! from the users.
20!!
21!! While Eos does not know anything about blocks, Eos_wrapped_blkid takes its
22!! input thermodynamic state variables from a given block's storage area.
23!! It works by taking a selected section of a block described by array
24!! "range" and translating it to eosData before calling the Eos routine.
25!! Upon return from Eos, Eos_wrapper updates certain state variables in
26!! the same section of the block's storage area. Which variables are taken
27!! as input, and which are updated, depends on the "mode" argument.
28!!
29!! If you want to return the derived quantities defined from EOS_VAR+1:EOS_NUM
30!! in Eos.h, then you must use the direct interface Eos().
31!!
32!!
33!! ARGUMENTS
34!!
35!!
36!! mode : determines which variables are used as Eos input.
37!! Valid values are MODE_DENS_EI (where density and internal
38!! energy are inputs), MODE_DENS_PRES (density and pressure as inputs)
39!! MODE_DENS_TEMP (density and temperature are inputs).
40!! These quantities are defined in constants.h, the argument is
41!! forwarded unchanged to the Eos function call.
42!! Note that internal energy is grid variable EINT_VAR, not ENER_VAR.
43!!
44!!
45!! range: an array that holds the lower and upper indices of the section
46!! of block on which Eos is to be applies. The example shows how
47!! the array describes the block section.
48!!
49!! blockID: current block number
50!!
51!! gridDataStruct : the grid data structure on whose data Eos is to be applied
52!!
53!!
54!! EXAMPLE
55!! if range(LOW,IAXIS)=1,range(HIGH,IAXIS)=iguard,
56!! range(LOW,JAXIS)=1,range(HIGH,JAXIS)=jguard,
57!! range(LOW,KAXIS)=1,range(HIGH,KAXIS)=kguard,
58!! then Eos is applied to the lower left hand corner of the guard
59!! cells in the block.
60!!
61!! However, if the value were
62!! range(LOW,IAXIS)=iguard+1,range(HIGH,IAXIS)=iguard+nxb,
63!! range(LOW,JAXIS)=jguard+1,range(HIGH,JAXIS)=jguard+nyb,
64!! range(LOW,KAXIS)=kguard+1,range(HIGH,KAXIS)=kguard+nzb,
65!! then Eos is applied to all the interior cells in the block.
66!!
67!! NOTES
68!! This interface is defined in Fortran Module
69!! Eos_interface. All functions calling this routine should include
70!! a statement like
71!! use Eos_interface, ONLY : Eos_wrapped_blkid
72!!
73!! This routine cannot use "INTERIOR" mode of indexing the range. In the
74!! second example given above, although only the interior cells are being
75!! calculated with EOS, the range indices still must include the guard cells.
76!! See, for example, IsentropicVortex/Simulation_initBlock where the data is
77!! generated on INTERIOR cells with Grid_putRowData, but the same indices can't
78!! be used for the EOS call.
79!!
80!! SEE ALSO
81!!
82!! Eos
83!! Eos.h
84!!
85!!***
86
87! solnData depends on the ordering on unk
88!!REORDER(4): solnData
89
90
91subroutine Eos_wrapped_blkid(mode,range,blockID, gridDataStruct)
92
93 use Driver_interface, ONLY : Driver_abortFlash
94 use Grid_interface, ONLY : Grid_getBlkPtr, Grid_releaseBlkPtr
95 use Logfile_interface, ONLY: Logfile_stampMessage
96 use Eos_interface, ONLY : Eos, Eos_putData, Eos_getData, Eos_wrapped
97 use Eos_data, ONLY : eos_threadWithinBlock
98 !$ use omp_lib
99 implicit none
100
101#include "Eos.h"
102#include "constants.h"
103#include "Flash.h"
104
105 integer, intent(in) :: mode
106 integer, dimension(2,MDIM), intent(in) :: range
107 integer,intent(in) :: blockID
108 integer, optional, intent(IN) :: gridDataStruct
109
110 real, pointer:: solnData(:,:,:,:)
111
112#ifndef FIXEDBLOCKSIZE
113 real, allocatable :: eosData(:),massFraction(:)
114#else
115 real, dimension(NSPECIES*MAXCELLS) :: massFraction
116 real, dimension(EOS_NUM*MAXCELLS) :: eosData
117#endif
118
119 logical,target,dimension(EOS_VARS+1:EOS_NUM) :: eosMask
120
121 integer :: ierr, dataStruct
122 integer :: i,j,k, vecLen
123 integer,dimension(MDIM) :: pos
124
125 call Grid_getBlkPtr(blockID,solnData,gridDataStruct)
126 call Eos_wrapped(mode,range,solnData, gridDataStruct)
127 call Grid_releaseBlkPtr(blockID,solnData,gridDataStruct)
128
129
130 return
131end subroutine Eos_wrapped_blkid
132
Note: See TracBrowser for help on using the repository browser.