!+ ! Subroutine bmad_write_lattice_to_file (ix_lat, file_name, n_char_name) ! ! Writes a Bmad lattice file ! ! Input: ! ix_lat -- Integer: Index of lattice to use. ! file_name -- Character(n_char_name): Name of file to create. ! n_char_name -- Integer: Length of file_name character string. !- subroutine bmad_write_lattice_to_file (ix_lat, file_name, n_char_name) use bmad_common_mod use transfer_map_mod use write_lat_file_mod implicit none type (lat_struct), pointer :: lat integer ix_lat, n_char_name character(1) file_name(*) character(120) f_name character(28), parameter :: r_name = 'bmad_write_lattice_to_file' ! if (lat_status(ix_lat) /= init_done$) then call out_io (s_error$, r_name, "Lattice \i0\ not yet initialized!", ix_lat) return endif lat => bd_com(ix_lat)%lat call remove_null_in_string(file_name, f_name) call write_bmad_lattice_file (f_name, lat) end subroutine