source: CIVL/examples/fortran/flash/eos_getData/eos_getData_new.f

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

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

  • Property mode set to 100644
File size: 3.5 KB
Line 
1subroutine Eos_getData(range,vecLen,solnData,gridDataStruct,eosData,massFrac, eosMask)
2
3 use Eos_data, ONLY: eos_eintSwitch, eos_smalle, eos_mapLookup
4 use Driver_interface, ONLY : Driver_abortFlash
5 use Eos_interface, ONLY : Eos_getData_loop1
6 implicit none
7
8#include "Eos.h"
9#include "Eos_map.h"
10#include "constants.h"
11#include "Flash.h"
12
13 integer, intent(in) :: vecLen, gridDataStruct
14 integer, dimension(LOW:HIGH,MDIM), intent(in) :: range
15 real, dimension(EOS_NUM*vecLen),intent(INOUT) :: eosData
16 real,dimension(:),optional,intent(OUT) :: massFrac
17 logical, optional, INTENT(INOUT),dimension(EOS_VARS+1:) :: eosMask
18 real, pointer:: solnData(:,:,:,:)
19
20
21 integer :: i,j,k,n,m,pres,dens,gamc,temp,abar,zbar,eint,ekin,entr
22 integer :: pres_map,dens_map,gamc_map,game_map,temp_map,entr_map
23 integer :: eint_map,ener_map, velx_map, vely_map, velz_map, sumy_map, ye_map
24 integer :: ib,ie,jb,je,kb,ke
25 real :: kineticEnergy, internalEnergy
26!! ---------------------------------------------------------------------------------
27! Test calling arguments
28
29! Initializations: grab the solution data from UNK and determine
30! the length of the data being operated upon
31
32 ib=range(LOW,IAXIS)
33 jb=range(LOW,JAXIS)
34 kb=range(LOW,KAXIS)
35 ie=range(HIGH,IAXIS)
36 je=range(HIGH,JAXIS)
37 ke=range(HIGH,KAXIS)
38!!$ select case(axis)
39!!$ case(IAXIS)
40!!$ ie=ie+vecLen-1
41!!$ case(JAXIS)
42!!$ je=je+vecLen-1
43!!$ case(KAXIS)
44!!$ ke=ke+vecLen-1
45!!$ end select
46! These integers are indexes into the location in eosData just before the storage area for the appropriate variable.
47 pres = (EOS_PRES-1)*vecLen
48 dens = (EOS_DENS-1)*vecLen
49 temp = (EOS_TEMP-1)*vecLen
50 gamc = (EOS_GAMC-1)*vecLen
51 eint = (EOS_EINT-1)*vecLen
52 ekin = (EOS_EKIN-1)*vecLen
53 abar = (EOS_ABAR-1)*vecLen
54 zbar = (EOS_ZBAR-1)*vecLen
55 entr = (EOS_ENTR-1)*vecLen
56
57 pres_map = eos_mapLookup(EOSMAP_PRES,EOS_IN,gridDataStruct)
58 dens_map = eos_mapLookup(EOSMAP_DENS,EOS_IN,gridDataStruct)
59 temp_map = eos_mapLookup(EOSMAP_TEMP,EOS_IN,gridDataStruct)
60 gamc_map = eos_mapLookup(EOSMAP_GAMC,EOS_IN,gridDataStruct)
61 game_map = eos_mapLookup(EOSMAP_GAME,EOS_IN,gridDataStruct)
62 eint_map = eos_mapLookup(EOSMAP_EINT,EOS_IN,gridDataStruct)
63 ener_map = eos_mapLookup(EOSMAP_ENER,EOS_IN,gridDataStruct)
64 velx_map = eos_mapLookup(EOSMAP_VELX,EOS_IN,gridDataStruct)
65 vely_map = eos_mapLookup(EOSMAP_VELY,EOS_IN,gridDataStruct)
66 velz_map = eos_mapLookup(EOSMAP_VELZ,EOS_IN,gridDataStruct)
67 sumy_map = eos_mapLookup(EOSMAP_SUMY,EOS_IN,gridDataStruct)
68 ye_map = eos_mapLookup(EOSMAP_YE, EOS_IN,gridDataStruct)
69 entr_map = eos_mapLookup(EOSMAP_ENTR,EOS_IN,gridDataStruct)
70
71 if(gridDataStruct == SCRATCH) then
72 call Driver_abortFlash("Eos_getData : the use of SCRATCH is deprecated")
73 end if
74
75 if(present(massFrac)) then
76 m=1
77 do k = kb,ke
78 do j = jb,je
79 do i = ib,ie
80 do n = SPECIES_BEGIN,SPECIES_END
81 massFrac(m) = solnData(n,i,j,k)
82 m=m+1
83 end do
84 end do
85 end do
86 end do
87 end if
88
89 n = 0
90 !! DEV: If / when we add a ptr dummy argument for passing in an offset, this will be n = ptr
91 do k = kb,ke
92 do j = jb,je
93 do i = ib,ie
94 call Eos_getData_loop1(vecLen, eosData, solnData, i,j,k,n, pres_map,dens_map,gamc_map,&
95 game_map,temp_map,entr_map,eint_map,ener_map, velx_map, vely_map, velz_map, &
96 sumy_map, ye_map, pres,dens,gamc,temp,abar,zbar,eint,ekin,entr)
97 end do
98 end do
99 end do
100
101 return
102end subroutine Eos_getData
Note: See TracBrowser for help on using the repository browser.