00001
00002 include '../Include_file/include_modulefiles_MRNS.f90'
00003 include '../Include_file/include_interface_modulefiles_MRNS.f90'
00004 include '../Include_file/include_PEOS_modulefile.f90'
00005 include '../Include_file/include_PEOS_subroutines.f90'
00006 include '../Include_file/include_subroutines_MRNS.f90'
00007 include '../Include_file/include_functions.f90'
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 PROGRAM Main_MagneticRNS_WL_peos
00034
00035 use grid_parameter, only : indata_type, outdata_type, &
00036 & iter_max, num_sol_seq, &
00037 & sw_mass_iter, sw_art_deform
00038 use def_matter, only : emd
00039 use def_matter_parameter, only : emdc
00040 use def_formulation
00041 implicit none
00042 integer :: flag_restmass, count_adj
00043 integer :: iseq, iter_count, total_iteration
00044
00045 call coordinate_patch_kit_grav
00046 call read_parameter_integrability_fnc_MHD
00047 call allocate_metric_and_matter_WL_MHD
00048 call allocate_emfield
00049 call allocate_SEM_tensor
00050 call allocate_SEM_tensor_EMF
00051 if (indata_type.eq.'1D') call IO_input_initial_1D
00052 if (indata_type.eq.'3D') call IO_input_initial_3D
00053 if (indata_type.eq.'3D') call IO_input_initial_3D_WL
00054 if (indata_type.eq.'3D') call IO_input_initial_3D_4ve
00055 if (indata_type.eq.'3D') call IO_input_initial_3D_EMF
00056 if (sw_mass_iter.eq.'y') emdc = emd(0,0,0)
00057
00058 if (sw_art_deform.eq.'y') call artificial_deformation
00059
00060 call choose_formulation
00061
00062 call peos_initialize
00063 call initialize_field
00064 if (indata_type.ne.'3D') call initialize_MRNS
00065
00066 do iseq = 1, num_sol_seq
00067 total_iteration = 0
00068 flag_restmass = 0
00069
00070
00071 count_adj = 0
00072 do
00073 call iteration_WL_MHD(iter_count)
00074 total_iteration = total_iteration + iter_count
00075 write(6,*)'-- Total # of iteration --', total_iteration
00076 call calc_physical_quantities_WL_MHD
00077 call printout_physq_console
00078 if (total_iteration.ge.iter_max) exit
00079 if (sw_mass_iter.ne.'y') exit
00080 call adjust_rest_mass(flag_restmass,count_adj)
00081 if (flag_restmass.eq.2) exit
00082 end do
00083 write(6,*)'== Solution sequence # == ', iseq
00084 if (total_iteration.ge.iter_max) then
00085 write(6,*)' ** Solution did not converge **'
00086 else
00087 if (sw_mass_iter.ne.'y') flag_restmass = 999
00088 end if
00089 call calc_physical_quantities_WL_MHD
00090 call calc_quad_pole_peos
00091
00092 call printout_physq_WL_MHD(iseq,flag_restmass)
00093 call printout_quad_pole(iseq)
00094 call printout_physq_plot(iseq,flag_restmass)
00095
00096 call printout_NS_shape_seq(iseq)
00097 call printout_emfield_strength(iseq)
00098 call next_solution
00099 end do
00100 if (outdata_type.eq.'1D') call IO_output_solution_1D
00101 if (outdata_type.eq.'3D') call IO_output_solution_3D
00102 if (outdata_type.eq.'3D') call IO_output_solution_3D_WL
00103 if (outdata_type.eq.'3D') call IO_output_solution_3D_4ve
00104 if (outdata_type.eq.'3D') call IO_output_solution_3D_EMF
00105
00106 call printout_NS_shape
00107 call write_parameter_integrability_fnc_MHD
00108
00109 END PROGRAM Main_MagneticRNS_WL_peos