| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | ✗ | program export_boozer_chartmap_app | |
| 2 | !> Export SIMPLE's VMEC->Boozer transform as a Boozer chartmap NetCDF. | ||
| 3 | !> | ||
| 4 | !> Reads field configuration from simple.in (netcdffile, ns_s, ns_tp, | ||
| 5 | !> multharm, axis healing), builds the internal Boozer field exactly as a | ||
| 6 | !> tracing run does, and writes the chartmap in the current schema (rho and | ||
| 7 | !> s coordinates, A_phi on the s abscissa, B_theta/B_phi on rho, Bmod on the | ||
| 8 | !> rho/theta/zeta grid). Lets SIMPLE's own field be compared against an | ||
| 9 | !> external booz_xform chartmap on equal footing. | ||
| 10 | !> | ||
| 11 | !> Usage: export_boozer_chartmap.x <out.nc> [config.in] (default simple.in) | ||
| 12 | |||
| 13 | use params, only: read_config, netcdffile, ns_s, ns_tp, multharm, & | ||
| 14 | ✗ | integmode, params_init, isw_field_type | |
| 15 | use simple, only: tracer_t | ||
| 16 | use simple_main, only: init_field | ||
| 17 | use boozer_chartmap, only: export_boozer_chartmap | ||
| 18 | use timing, only: init_timer, print_phase_time | ||
| 19 | |||
| 20 | implicit none | ||
| 21 | |||
| 22 | integer, parameter :: BOOZER_FIELD_TYPE = 2 | ||
| 23 | character(1024) :: out_file | ||
| 24 | character(256) :: config_file | ||
| 25 | type(tracer_t) :: norb | ||
| 26 | |||
| 27 | ✗ | call init_timer() | |
| 28 | |||
| 29 | ✗ | if (command_argument_count() < 1) then | |
| 30 | ✗ | write(*, '(A)') 'Usage: export_boozer_chartmap.x <out.nc> [config.in]' | |
| 31 | ✗ | error stop 'missing output file argument' | |
| 32 | end if | ||
| 33 | ✗ | call get_command_argument(1, out_file) | |
| 34 | ✗ | if (command_argument_count() >= 2) then | |
| 35 | ✗ | call get_command_argument(2, config_file) | |
| 36 | else | ||
| 37 | ✗ | config_file = 'simple.in' | |
| 38 | end if | ||
| 39 | |||
| 40 | ✗ | call read_config(config_file) | |
| 41 | ✗ | call print_phase_time('Configuration reading completed') | |
| 42 | |||
| 43 | ✗ | if (isw_field_type /= BOOZER_FIELD_TYPE) then | |
| 44 | write(*, '(A,I0)') 'ERROR: export_boozer_chartmap needs isw_field_type = 2 & | ||
| 45 | ✗ | &(Boozer); got ', isw_field_type | |
| 46 | ✗ | error stop 'incorrect field type for Boozer chartmap export' | |
| 47 | end if | ||
| 48 | |||
| 49 | ✗ | call init_field(norb, netcdffile, ns_s, ns_tp, multharm, integmode) | |
| 50 | ✗ | call params_init | |
| 51 | ✗ | call print_phase_time('Field initialization completed') | |
| 52 | |||
| 53 | ✗ | call export_boozer_chartmap(out_file) | |
| 54 | ✗ | call print_phase_time('Chartmap export completed') | |
| 55 | ✗ | write(*, '(A)') 'Written '//trim(out_file) | |
| 56 | |||
| 57 | ✗ | end program export_boozer_chartmap_app | |
| 58 |