Merge branch 'master' into reconnection

This commit is contained in:
Grzegorz Kowal 2022-10-19 20:48:28 -03:00
commit 2d4ac65efb
6 changed files with 23 additions and 19 deletions

View File

@ -66,7 +66,7 @@ if(ENABLE_MPI)
endif()
endif()
option(ENABLE_OPENMP "Enable OpenMP support." ON)
option(ENABLE_OPENMP "Enable OpenMP support." OFF)
if(ENABLE_OPENMP)
find_package(OpenMP COMPONENTS Fortran)
if(OpenMP_Fortran_FOUND)

View File

@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
setuptools.setup(
name="amunpy",
version="0.9.7",
version="0.9.8",
author="Grzegorz Kowal",
author_email="grzegorz@amuncode.org",
description="Python Interface for the AMUN code's snapshots",

View File

@ -21,6 +21,6 @@ __all__ = [ 'AmunXML', 'AmunH5', 'WriteVTK', \
__author__ = "Grzegorz Kowal"
__copyright__ = "Copyright 2018-2022 Grzegorz Kowal <grzegorz@amuncode.org>"
__version__ = "0.9.7"
__version__ = "0.9.8"
__maintainer__ = "Grzegorz Kowal"
__email__ = "grzegorz@amuncode.org"

View File

@ -177,14 +177,18 @@ class Amun:
"""
Add derived variables.
"""
denflag = 'dens' in self.variables
preflag = 'pres' in self.variables
velflag = all(v in self.variables for v in ['velx','vely','velz'])
magflag = all(v in self.variables for v in ['magx','magy','magz'])
self.variables['refinement level'] = 'mlev'
if 'dens' in self.variables:
if denflag:
self.variables['density'] = 'dens'
self.variables['logarithm of density'] = 'logd'
if 'pres' in self.variables or self.attributes['eos'] == 'iso':
if preflag or self.attributes['eos'] == 'iso':
self.variables['pressure'] = 'pres'
self.variables['logarithm of pressure'] = 'logp'
if all(v in self.variables for v in ['velx','vely','velz']):
if velflag:
self.variables['velocity'] = 'vvec'
self.variables['velocity magnitude'] = 'velo'
self.variables['x-velocity'] = 'velx'
@ -196,7 +200,7 @@ class Amun:
self.variables['z-vorticity'] = 'vorz'
self.variables['vorticity'] = 'wvec'
self.variables['vorticity magnitude'] = 'vort'
if all(v in self.variables for v in ['magx','magy','magz']):
if magflag:
self.variables['magnetic field'] = 'bvec'
self.variables['magnetic field magnitude'] = 'magn'
self.variables['x-magnetic field'] = 'magx'
@ -210,25 +214,22 @@ class Amun:
self.variables['current density magnitude'] = 'curr'
if 'bpsi' in self.variables:
self.variables['magnetic divergence potential'] = 'bpsi'
if 'pres' in self.variables and 'adiabatic_index' in self.attributes:
if preflag and 'adiabatic_index' in self.attributes:
self.variables['internal energy'] = 'eint'
if all(v in self.variables for v in ['dens', 'pres']):
if denflag and preflag:
self.variables['temperature'] = 'temp'
if self.attributes['eqsys'] in [ 'hd', 'mhd' ] \
and all(v in self.variables for v in ['dens','velx','vely','velz']):
if self.attributes['eqsys'] in ['hd','mhd'] and denflag and velflag:
self.variables['kinetic energy'] = 'ekin'
if self.attributes['eqsys'] in [ 'mhd', 'srmhd' ] \
and all(v in self.variables for v in ['magx','magy','magz']):
if self.attributes['eqsys'] in ['mhd','srmhd'] and magflag:
self.variables['magnetic energy'] = 'emag'
self.variables['magnetic pressure'] = 'emag'
if all(v in self.variables for v in ['velx','vely','velz', 'magx','magy','magz']) in self.variables:
if velflag and magflag:
self.variables['electric field'] = 'evec'
self.variables['electric field magnitude'] = 'elec'
self.variables['x-electric field'] = 'elex'
self.variables['y-electric field'] = 'eley'
self.variables['z-electric field'] = 'elez'
if self.attributes['eqsys'] in [ 'srhd', 'srmhd' ] \
and all(v in self.variables for v in ['velx','vely','velz']):
if self.attributes['eqsys'] in ['srhd','srmhd'] and velflag:
self.variables['Lorentz factor'] = 'lore'
delete_datasets = ['dens','pres','velx','vely','velz','magx','magy','magz','bpsi']

View File

@ -316,7 +316,7 @@ module boundaries
#ifdef MPI
use blocks , only : block_info, pointer_info
#endif /* MPI */
use blocks , only : ndims, nsides
use blocks , only : nsides
use coordinates, only : minlev, maxlev
use coordinates, only : nh => ncells_half
use coordinates, only : nb, ne, nbm, nbp, nem, nep
@ -862,7 +862,6 @@ module boundaries
!
subroutine boundary_variables(t, dt, status)
use blocks , only : ndims
use coordinates, only : minlev, maxlev
implicit none

View File

@ -1391,7 +1391,11 @@ module equations
use blocks , only : block_data
use coordinates, only : nn => bcells
use helpers , only : print_message
#if NDIMS == 3
use coordinates, only : ax, ay, az
#else /* NDIMS == 3 */
use coordinates, only : ax, ay
#endif /* NDIMS == 3 */
implicit none