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.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
00016
00017 use grid_parameter, only : indata_type, outdata_type, &
00018 & iter_max, num_sol_seq, nrf_deform, &
00019 & sw_mass_iter, sw_art_deform, ntfxy, &
00020 & chrot, chgra, chope
00021 use def_matter, only : emd
00022 use def_matter_parameter, only : emdc
00023 use def_quantities, only : dhdr_x, dhdr_y, dhdr_z
00024 implicit none
00025 integer :: flag_restmass, count_adj
00026 integer :: iseq, iter_count, total_iteration, nmx
00027 character(40) :: char1, char2, char3, char4, char5
00028 character(LEN=300) :: cmd
00029
00030 call coordinate_patch_kit_grav
00031 call read_parameter_drot
00032 call allocate_metric_and_matter
00033 call allocate_metric_on_SFC_CF
00034 call allocate_excurve_on_SFC_CF
00035 if (indata_type.eq.'1D') call IO_input_initial_1D
00036 if (indata_type.eq.'3D') call IO_input_initial_3D
00037 if (sw_mass_iter.eq.'y') then
00038 call search_emdmax_xaxis_grid(nmx)
00039 emdc = emd(nmx,ntfxy,0)
00040 end if
00041
00042 if (sw_art_deform.eq.'y') call artificial_deformation
00043
00044 call peos_initialize
00045
00046 if (chrot=='p' .and. chgra=='e' .and. chope=='r') then
00047 iseq=1; flag_restmass=999
00048 write(6,*) "************************ ADDING A PERTURBATION ********************************"
00049 call input_perturbation_peos
00050 call iteration_peos(iter_count)
00051 call calc_physical_quantities_peos_v1
00052 call calc_quad_pole_peos(iseq)
00053 write(6,*) "Basic quantities after perturbation is applied:"
00054 call printout_physq_console
00055
00056 call printout_physq_peos_v1(iseq,flag_restmass)
00057 call printout_quad_pole(iseq)
00058 call printout_physq_plot(iseq,flag_restmass)
00059 else
00060 do iseq = 1, num_sol_seq
00061 total_iteration = 0
00062 flag_restmass = 0
00063
00064
00065 count_adj = 0
00066 do
00067 call iteration_peos(iter_count)
00068 total_iteration = total_iteration + iter_count
00069 write(6,*)'-- Total # of iteration --', total_iteration
00070 call calc_physical_quantities_peos_v1
00071 call printout_physq_console
00072 if (total_iteration.ge.iter_max) exit
00073 if (sw_mass_iter.ne.'y') exit
00074 write(6,*) "Adjust mass", count_adj
00075 call adjust_rest_mass(flag_restmass,count_adj)
00076 if (flag_restmass.eq.2) exit
00077 end do
00078 write(6,*)'== Solution sequence # == ', iseq
00079 if (total_iteration.ge.iter_max) then
00080 write(6,*)' ** Solution did not converge **'
00081 else
00082 if (sw_mass_iter.ne.'y') flag_restmass = 999
00083 end if
00084 call calc_physical_quantities_peos_v1
00085 call calc_quad_pole_peos
00086
00087
00088
00089
00090 call printout_physq_peos_v1(iseq,flag_restmass)
00091 call printout_quad_pole(iseq)
00092 call printout_physq_plot(iseq,flag_restmass)
00093
00094
00095
00096
00097 if ( iseq==24 ) then
00098 call open_directory(iseq,0)
00099 call IO_output_solution_3D
00100 call system("rm -f rnsgrids_3D.las")
00101 write(char1, '(i5)') iseq; char2 = adjustl(char1)
00102 write(char3, '(i5)') nrf_deform; char4 = adjustl(char3)
00103 cmd = "echo 'iseq, nrf_deform : " // trim(char2) // " " // trim(char4) // " ' > deformation.txt"
00104 call system(cmd)
00105 call chdir('../')
00106 end if
00107
00108 call printout_NS_shape_seq(iseq)
00109 call next_solution
00110 end do
00111 end if
00112 if (outdata_type.eq.'1D') call IO_output_solution_1D
00113 if (outdata_type.eq.'3D') call IO_output_solution_3D
00114
00115 call printout_NS_shape
00116
00117 END PROGRAM Main_RNS_CF_peos