File: test-ambiguous-units.f90

package info (click to toggle)
libfdf 0.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 552 kB
  • sloc: f90: 4,028; perl: 805; python: 174; sh: 116; makefile: 99
file content (28 lines) | stat: -rw-r--r-- 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
!
!     Shows FDF units capabilities
!
PROGRAM test_ambiguous_units
  USE fdf
  use units_ambiguous_m, only: inquire_unit
  USE fdf_prec
  implicit none
  
  real(dp)                   :: mass, bfield, ion_energy

! Initialize
  call fdf_init('ambiguous-units.fdf', 'ambiguous-units.out')

  call fdf_set_unit_handler(inquire_unit)

  mass = fdf_physical('body-mass', 0.5d0, 'Kg')
  write(6,*) 'Body-mass: ', mass

  bfield = fdf_physical('Bfield', 4.5d0, 'bfield:G')
  write(6,*) 'Bfield:', bfield

  ion_energy = fdf_physical('ion-energy', 40.d0, 'J')
  write(6,*) 'ion_energy:', ion_energy

  call fdf_shutdown()

END PROGRAM TEST_AMBIGUOUS_UNITS