Skip to content

Commit

Permalink
add clear-code interface
Browse files Browse the repository at this point in the history
no changes of algorithms
  • Loading branch information
Arhathsis authored Aug 26, 2021
1 parent 36e26bf commit 9586adf
Show file tree
Hide file tree
Showing 13 changed files with 1,463 additions and 1,068 deletions.
16 changes: 16 additions & 0 deletions COSMOD_Catalogs.f95
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!=- fortran-libraries
!=- © Stanislav Shirokov, 2014-2020

module COSMOD_catalogs
use global
use COSMOD_paths
use math
use GNUplot

character(len) :: Data_catalogs(100) = 'NaN'

contains



end module
117 changes: 90 additions & 27 deletions COSMOD_Citadel.f95
Original file line number Diff line number Diff line change
Expand Up @@ -8,60 +8,123 @@ module COSMOD_citadel
use COSMOD_graphics
use COSMOD_tables
use COSMOD_scripts

character(len) :: OS
use COSMOD_overleaf

contains

!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

subroutine commands
call preparation
do
call input_command(commandN)
select case (commandN(1))

!=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=!

case('mn2021a')
call mn2021a

subroutine preparation
case('mn2020b')
call mn2020b

call define_system
if (operation_system==1) OS = 'Windows'
write(*,*) 'OS: ',trim(OS)
call paths
call gen_folders
case('mn2020a')
call mn2020a

write(*,*) 'COSMOD citadel is run..'
case('example')
call example

end subroutine
!=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=!

case('exit')
exit

case default
write(*,*) 'unknown command'

subroutine commands
end select

call preparation
call set_default

enddo
end subroutine

!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

subroutine mn2021a
!=- If there is more one argument in command -=1
if ( word_search_array( commandN , 'fig1' ) ) call mn2021a_fig1
!if ( word_search_array( commandN , 'tab1' ) ) call mn2021a_plot_tab1
!if ( word_search_array( commandN , 'o' ) ) call mn2021a_overleaf
!=- default command without additional arguments -=1
if ( commandN(2)=='NaN' ) then
call mn2021a_fig1
!call mn2021a_plot_tab1
!call mn2021a_overleaf
end if

do ; write(*,*) 'Enter the command:' ; read (*,*) command
end subroutine

select case (command)
!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

subroutine mn2020b
!=- If there is more one argument in command -=1
if ( word_search_array( commandN , 'fig1' ) ) call mn2020b_plot_fig1
if ( word_search_array( commandN , 'tab1' ) ) call mn2020b_plot_tab1
if ( word_search_array( commandN , 'o' ) ) call mn2020b_overleaf
!=- default command without additional arguments -=1
if ( commandN(2)=='NaN' ) then
call mn2020b_plot_tab1
call mn2020b_plot_fig1
call mn2020b_overleaf
end if

end subroutine

case ('overleaf') ; call make_overleaf_figures_folder
case ('o') ; call make_overleaf_figures_folder
!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

case ('cosmod')
call COSMOD_model_set
case ('c')
call COSMOD_model_set
subroutine mn2020a
!=- If there is more one argument in command -=1
if ( word_search_array( commandN , 'fig3' ) ) call mn2020a_plot_fig3
if ( word_search_array( commandN , 'o' ) ) call mn2020a_overleaf
!=- default command without additional arguments -=1
if ( commandN(2)=='NaN' ) then
call mn2020a_plot_fig3
call mn2020a_overleaf
end if

case ('fig1') ; call MN_Letter_plot_fig1
end subroutine

case ('tab1') ; call MN_Letter_plot_tab1
!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

case ('exit') ; exit
subroutine preparation
call define_system
call paths
write(*,*) 'COSMOD citadel has runned'
end subroutine

case default ; write(*,*) 'unknown command'

end select
!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

enddo
subroutine input_command(commandN)
character(len) command,commandN(:)
33 continue ; write(*,*) '--' ; commandN(:)='NaN'

read(*,'(A256)',err=33,end=44) command
read(command,*,iostat=iostat_value,err=33,end=44) commandN ; 44 continue

end subroutine

!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

subroutine set_default !=- ?

call MS_default
call overleaf_default
call math_default

end subroutine

!=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=%=!

end module
!=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- truncated=136-=1
8 changes: 6 additions & 2 deletions COSMOD_Config.f95
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
!=- fortran-libraries
!=- © Stanislav Shirokov, 2014-2020

module COSMOD_config
module COSMOD_config
use global

character(len),parameter :: CosMod_Version = '1.0'

logical :: GRB_medians_flag = .true.

end module
end module
!=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- truncated=136-=1
Loading

0 comments on commit 9586adf

Please sign in to comment.