mag_ncdf.f90 Source File


This file depends on

sourcefile~~mag_ncdf.f90~~EfferentGraph sourcefile~mag_ncdf.f90 mag_ncdf.f90 sourcefile~io.f90 io.f90 sourcefile~mag_ncdf.f90->sourcefile~io.f90 sourcefile~timeutils.f90 timeutils.f90 sourcefile~mag_ncdf.f90->sourcefile~timeutils.f90 sourcefile~grid.f90 grid.f90 sourcefile~io.f90->sourcefile~grid.f90 sourcefile~mpimod.f90 mpimod.F90 sourcefile~io.f90->sourcefile~mpimod.f90 sourcefile~phys_consts.f90 phys_consts.F90 sourcefile~io.f90->sourcefile~phys_consts.f90 sourcefile~pathlib.f90 pathlib.f90 sourcefile~io.f90->sourcefile~pathlib.f90 sourcefile~timeutils.f90->sourcefile~phys_consts.f90 sourcefile~grid.f90->sourcefile~mpimod.f90 sourcefile~grid.f90->sourcefile~phys_consts.f90 sourcefile~mesh.f90 mesh.f90 sourcefile~grid.f90->sourcefile~mesh.f90 sourcefile~reader.f90 reader.f90 sourcefile~grid.f90->sourcefile~reader.f90 sourcefile~mpimod.f90->sourcefile~phys_consts.f90 sourcefile~mesh.f90->sourcefile~phys_consts.f90 sourcefile~reader.f90->sourcefile~phys_consts.f90

Contents

Source Code


Source Code

submodule (io) mag_hdf5

use timeutils, only: date_filename
use nc4fortran, only: netcdf_file
implicit none

contains

module procedure output_magfields
!! WE ASSUME THE ROOT PROCESS HAS ALREADY REDUCED THE MAGNETIC FIELD DATA

type(netcdf_file) :: hout

character(:), allocatable :: filenamefull
integer :: ierr

filenamefull = date_filename(outdir // '/magfields/',ymd,UTsec) // '.h5'
print *, '  Output file name (magnetic fields):  ',filenamefull

call hout%initialize(filenamefull, ierr, status='unknown',action='rw',comp_lvl=1)

call hout%write('/magfields/Br', Br, ierr)
call hout%write('/magfields/Btheta', Btheta, ierr)
call hout%write('/magfields/Bphi', Bphi, ierr)

call hout%finalize(ierr)

end procedure output_magfields

end submodule mag_hdf5