00001
00002
00003
00004
00005 include '../Include_file/include_modulefiles_RNS_CF_peos.f90'
00006 include '../Include_file/include_interface_modulefiles_RNS_CF_peos.f90'
00007 include '../Include_file/include_subroutines_RNS_CF_peos_gp4th.f90'
00008 include '../Include_file/include_PEOS_modulefile.f90'
00009 include '../Include_file/include_PEOS_subroutines.f90'
00010 include '../Include_file/include_functions.f90'
00011
00012
00013
00014
00015 PROGRAM Main_RNS_CF_peos_gp4th
00016
00017 use grid_parameter
00018 use def_matter, only : emd
00019 use def_matter_parameter, only : emdc
00020 use def_quantities, only : dhdr_x, dhdr_y, dhdr_z
00021 use def_peos_parameter, only : emdini_gcm1
00022 use interface_violation_midpoint_MoC_CF_peos
00023 use interface_violation_gridpoint_MoC_CF_peos
00024 use interface_violation_midpoint_HaC_CF_peos
00025 use interface_violation_gridpoint_HaC_CF_peos
00026 use interface_IO_output_3D_general
00027 use interface_IO_output_2D_general
00028 use interface_IO_output_1D_general
00029 use make_array_2d
00030 use make_array_3d
00031 use make_array_4d
00032 implicit none
00033 integer :: flag_restmass, count_adj
00034 integer :: iseq, iter_count, total_iteration
00035 real(long), pointer :: pot(:,:,:), HaC_vio(:,:,:), MoC_vio(:,:,:,:)
00036 character(30) :: char1, char2, char3, char4, char5
00037
00038 call coordinate_patch_kit_grav
00039 call read_parameter_drot
00040 call allocate_metric_and_matter
00041 call allocate_metric_on_SFC_CF
00042 if (indata_type.eq.'1D') call IO_input_initial_1D
00043 if (indata_type.eq.'3D') call IO_input_initial_3D
00044 if (sw_mass_iter.eq.'y') emdc = emd(0,0,0)
00045
00046 if (sw_art_deform.eq.'y') call artificial_deformation
00047
00048 call peos_initialize
00049
00050
00051
00052 do iseq = 1, num_sol_seq
00053 total_iteration = 0
00054 flag_restmass = 0
00055
00056
00057 count_adj = 0
00058 do
00059 call iteration_peos_gp4th(iter_count)
00060 total_iteration = total_iteration + iter_count
00061 write(6,*)'-- Total # of iteration --', total_iteration
00062 call calc_physical_quantities_peos
00063 call printout_physq_console
00064 if (total_iteration.ge.iter_max) exit
00065 if (sw_mass_iter.ne.'y') exit
00066 call adjust_rest_mass(flag_restmass,count_adj)
00067 if (flag_restmass.eq.2) exit
00068 end do
00069 write(6,*)'== Solution sequence # == ', iseq
00070 if (total_iteration.ge.iter_max) then
00071 write(6,*)' ** Solution did not converge **'
00072 else
00073 if (sw_mass_iter.ne.'y') flag_restmass = 999
00074 end if
00075 call calc_physical_quantities_peos
00076 call calc_quad_pole_peos(iseq)
00077
00078
00079
00080 call printout_physq_peos(iseq,flag_restmass)
00081 call printout_physq_peos_v1(iseq,flag_restmass)
00082 call printout_quad_pole(iseq)
00083 call printout_physq_plot(iseq,flag_restmass)
00084
00085 call printout_NS_shape_seq(iseq)
00086 call next_solution
00087 end do
00088 if (outdata_type.eq.'1D') call IO_output_solution_1D
00089 if (outdata_type.eq.'3D') call IO_output_solution_3D
00090
00091 call printout_NS_shape
00092
00093 call alloc_array4d(MoC_vio,0,nrg,0,ntg,0,npg,1,3)
00094 call alloc_array3d(HaC_vio,0,nrg,0,ntg,0,npg)
00095 call alloc_array3d(pot,0,nrg,0,ntg,0,npg)
00096 call excurve_CF('ns')
00097 call excurve_CF_gridpoint
00098
00099 MoC_vio(0:nrg,0:ntg,0:npg,1:3) = 0.0d0
00100 call violation_gridpoint_MoC_CF_peos(MoC_vio)
00101 pot = 0.0d0
00102 pot(0:nrg,0:ntg,0:npg) = MoC_vio(0:nrg,0:ntg,0:npg,2)
00103 char1 = 'MoC_by_3D.txt'
00104 call IO_output_3D_general(char1,'g','g',pot)
00105 char1 = 'MoC_by_xy.txt'
00106 call IO_output_2D_general(char1,'g','g',pot,'xy')
00107 char1 = 'MoC_by_phi000.txt'
00108 call IO_output_1D_general(char1,'g','g',pot,-1,ntg/2,0)
00109 char1 = 'MoC_by_phi180.txt'
00110 call IO_output_1D_general(char1,'g','g',pot,-1,ntg/2,npg/2)
00111
00112 HaC_vio = 0.0d0
00113 call violation_gridpoint_HaC_CF_peos(HaC_vio)
00114 char1 = 'HaC_3D.txt'
00115 call IO_output_3D_general(char1,'g','g',HaC_vio)
00116 char1 = 'HaC_xy.txt'
00117 call IO_output_2D_general(char1,'g','g',HaC_vio,'xy')
00118 char1 = 'HaC_phi000.txt'
00119 call IO_output_1D_general(char1,'g','g',HaC_vio,-1,ntg/2,0)
00120 char1 = 'HaC_phi180.txt'
00121 call IO_output_1D_general(char1,'g','g',HaC_vio,-1,ntg/2,npg/2)
00122
00123 HaC_vio = 0.0d0
00124 call violation_midpoint_HaC_CF_peos(HaC_vio)
00125 char1 = 'HaC_3D_mid.txt'
00126 call IO_output_3D_general(char1,'g','m',HaC_vio)
00127 char1 = 'HaC_xy_mid.txt'
00128 call IO_output_2D_general(char1,'g','m',HaC_vio,'xy')
00129 char1 = 'HaC_phi000_mid.txt'
00130 call IO_output_1D_general(char1,'g','m',HaC_vio,-1,ntg/2,1)
00131 char1 = 'HaC_phi180_mid.txt'
00132 call IO_output_1D_general(char1,'g','m',HaC_vio,-1,ntg/2,npg/2)
00133
00134 deallocate(MoC_vio)
00135 deallocate(HaC_vio)
00136 deallocate(pot)
00137
00138 END PROGRAM Main_RNS_CF_peos_gp4th