mag_raw.f90 Source File


This file depends on

sourcefile~~mag_raw.f90~~EfferentGraph sourcefile~mag_raw.f90 mag_raw.f90 sourcefile~io.f90 io.f90 sourcefile~mag_raw.f90->sourcefile~io.f90 sourcefile~timeutils.f90 timeutils.f90 sourcefile~mag_raw.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_raw

use timeutils, only: date_filename
implicit none

contains

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

character(:), allocatable :: outdir_composite, filenamefull


!FORM THE INPUT FILE NAME
outdir_composite=outdir//'/magfields/'
filenamefull=date_filename(outdir_composite,ymd,UTsec) // '.dat'
print *, '  Output file name (magnetic fields):  ',filenamefull
block
  integer :: u
  open(newunit=u,file=filenamefull,status='replace',form='unformatted',access='stream',action='write')

  !> DUMP THE OUTPUT DATA
  write(u) Br,Btheta,Bphi
  close(u)
end block

if(.not. all(ieee_is_finite(Br))) error stop 'Br: non-finite value(s)'
if(.not. all(ieee_is_finite(Btheta))) error stop 'Btheta: non-finite value(s)'
if(.not. all(ieee_is_finite(Bphi))) error stop 'Bphi: non-finite value(s)'

end procedure output_magfields

end submodule mag_raw