00001
00002 include '../Include_file/include_modulefiles_RNS_WL_peos.f90'
00003 include '../Include_file/include_interface_modulefiles_RNS_WL_peos.f90'
00004 include '../Include_file/include_subroutines_RNS_WL_peos.f90'
00005 include '../Include_file/include_PEOS_modulefile.f90'
00006 include '../Include_file/include_PEOS_subroutines.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_RNS_WL_peos
00034
00035 use grid_parameter, only : indata_type, outdata_type, &
00036 & iter_max, num_sol_seq, nrf_deform, &
00037 & sw_mass_iter, sw_art_deform, ntfxy, &
00038 & chrot, chgra, chope
00039 use def_matter, only : emd
00040 use def_matter_parameter, only : emdc
00041 use def_formulation
00042 implicit none
00043 integer :: flag_restmass, count_adj
00044 integer :: iseq, iter_count, total_iteration, nmx
00045 character(40) :: char1, char2, char3, char4, char5
00046 character(LEN=300) :: cmd
00047
00048 call coordinate_patch_kit_grav
00049 call read_parameter_drot
00050 call allocate_metric_and_matter_WL
00051 call allocate_SEM_tensor
00052 if (indata_type.eq.'1D') call IO_input_initial_1D
00053 if (indata_type.eq.'3D') call IO_input_initial_3D
00054 if (indata_type.eq.'3D') call IO_input_initial_3D_WL
00055 if (sw_mass_iter.eq.'y') then
00056 call search_emdmax_xaxis_grid(nmx)
00057 emdc = emd(nmx,ntfxy,0)
00058 end if
00059
00060 if (sw_art_deform.eq.'y') call artificial_deformation
00061
00062 call choose_formulation
00063
00064 call peos_initialize
00065 call initialize_field
00066
00067 if (chrot=='p' .and. chgra=='e' .and. chope=='r') then
00068 iseq=1; flag_restmass=999
00069 write(6,*) "************************ ADDING A PERTURBATION ********************************"
00070 call input_perturbation_peos
00071 call iteration_WL(iter_count)
00072 call calc_physical_quantities_WL_v1
00073 call calc_quad_pole_peos(iseq)
00074 write(6,*) "Basic quantities after perturbation is applied:"
00075 call printout_physq_console
00076
00077 call printout_physq_WL_MHD_v1(iseq,flag_restmass)
00078 call printout_quad_pole(iseq)
00079 call printout_physq_plot(iseq,flag_restmass)
00080 else
00081 do iseq = 1, num_sol_seq
00082 total_iteration = 0
00083 flag_restmass = 0
00084
00085
00086 count_adj = 0
00087 do
00088 call iteration_WL(iter_count)
00089 total_iteration = total_iteration + iter_count
00090 write(6,*)'-- Total # of iteration --', total_iteration
00091 call calc_physical_quantities_WL_v1
00092 call printout_physq_console
00093 if (total_iteration.ge.iter_max) exit
00094 if (sw_mass_iter.ne.'y') exit
00095 call adjust_rest_mass(flag_restmass,count_adj)
00096 if (flag_restmass.eq.2) exit
00097 end do
00098 write(6,*)'== Solution sequence # == ', iseq
00099 if (total_iteration.ge.iter_max) then
00100 write(6,*)' ** Solution did not converge **'
00101 else
00102 if (sw_mass_iter.ne.'y') flag_restmass = 999
00103 end if
00104 call calc_physical_quantities_WL_v1
00105 call calc_quad_pole_peos
00106
00107 call printout_physq_WL_MHD_v1(iseq,flag_restmass)
00108 call printout_quad_pole(iseq)
00109 call printout_physq_plot(iseq,flag_restmass)
00110
00111
00112
00113
00114 if ( iseq==24 ) then
00115 call open_directory(iseq,0)
00116 call IO_output_solution_3D
00117 call IO_output_solution_3D_WL
00118 call system("rm -f rnsgrids_3D.las")
00119 write(char1, '(i5)') iseq; char2 = adjustl(char1)
00120 write(char3, '(i5)') nrf_deform; char4 = adjustl(char3)
00121 cmd = "echo 'iseq, nrf_deform : " // trim(char2) // " " // trim(char4) // " ' > deformation.txt"
00122 call system(cmd)
00123 call chdir('../')
00124 end if
00125
00126
00127 call printout_NS_shape_seq(iseq)
00128 call next_solution
00129 end do
00130 end if
00131 if (outdata_type.eq.'1D') call IO_output_solution_1D
00132 if (outdata_type.eq.'3D') call IO_output_solution_3D
00133 if (outdata_type.eq.'3D') call IO_output_solution_3D_WL
00134
00135 call printout_NS_shape
00136
00137 END PROGRAM Main_RNS_WL_peos