Skip to content

Commit

Permalink
move print_model_init to configuration.F90
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Hamman committed Mar 10, 2017
1 parent b78eab8 commit 8f80e1d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 41 deletions.
37 changes: 35 additions & 2 deletions src/config/configuration.f90
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!>------------------------------------------------
!! Reads the configuration input file
!! Also looks for commandline arguments to for an config filename
!! Also looks for command line arguments to for an config filename
!!
!! @author
!! Ethan Gutmann ([email protected])
Expand All @@ -12,14 +12,14 @@ module config_mod
use model_constants
use string, only : str
use io_routines, only : io_newunit
use init_mod, only : print_model_init

implicit none
private

logical :: module_debug
public :: read_config
public :: read_files_list, read_data_type, get_options_file ! only need to be public for test_config
public :: print_model_init
contains

!>------------------------------------------------
Expand Down Expand Up @@ -797,4 +797,37 @@ function get_options_file() result(options_file)
write(*,*) "Using options file = ", trim(options_file)
end function get_options_file

!>------------------------------------------------
!! Prints model configuration info before running
!!
!! Prints a welcome and version string as well.
!!------------------------------------------------
subroutine print_model_init()
implicit none

write(*,*) "Generalized Analog Regression Downscaling (GARD)"
write(*,*) "-----------------------------------------------------------"
write(*,*) "GARD Version : "//trim(kVERSION_STRING)
! TODO: Add compile time options
write(*,*) ""
write(*,*) " The Generalized Analog Regression Downscaling (GARD)"
write(*,*) " downscaling tool, version "//trim(kVERSION_STRING)//", Copyright (C) 2017 The"
write(*,*) " National Center for Atmospheric Research. GARD comes with"
write(*,*) " ABSOLUTELY NO WARRANTY. This is free software, you may "
write(*,*) " redistribute it under certain conditions; see LICENSE.txt"
write(*,*) " for details."
write(*,*) ""
write(*,*) " Online Documentation : http://gard.readthedocs.io"
write(*,*) " Report Bugs and Issues to : https://github.com/NCAR/GARD/issues"
write(*,*) ""
write(*,*) "-----------------------------------------------------------"
write(*,*) "Usage: gard [-h] [--version] options_file"
write(*,*) ""
write(*,*) "-h Help information for GARD"
write(*,*) "--version Print the version number"
write(*,*) "options_file Input options file name"
write(*,*) ""

end subroutine print_model_init

end module config_mod
38 changes: 1 addition & 37 deletions src/main/init.f90
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,9 @@ module init_mod

implicit none
private
public :: model_init, print_model_init
public :: model_init
contains

!>------------------------------------------------
!! Prints model configuration info before running
!!
!! Prints a welcome and version string as well.
!! Only prints configuration info if debug == true
!!
!!------------------------------------------------
subroutine print_model_init()
implicit none

write(*,*) "Generalized Analog Regression Downscaling (GARD)"
write(*,*) "-----------------------------------------------------------"
write(*,*) "GARD Version : "//trim(kVERSION_STRING)
! TODO: Add compile time options
write(*,*) ""
write(*,*) " The Generalized Analog Regression Downscaling (GARD)"
write(*,*) " downscaling tool, version "//trim(kVERSION_STRING)//", Copyright (C) 2017 The"
write(*,*) " National Center for Atmospheric Research. GARD comes with"
write(*,*) " ABSOLUTELY NO WARRANTY. This is free software, you may "
write(*,*) " redistribute it under certain conditions; see LICENSE.txt"
write(*,*) " for details."
write(*,*) ""
write(*,*) " Online Documentation : http://gard.readthedocs.io"
write(*,*) " Report Bugs and Issues to : https://github.com/NCAR/GARD/issues"
write(*,*) ""
write(*,*) "-----------------------------------------------------------"
write(*,*) "Usage: gard [-h] [--version] options_file"
write(*,*) ""
write(*,*) "-h Help information for GARD"
write(*,*) "--version Print the version number"
write(*,*) "options_file Input options file name"
write(*,*) ""

end subroutine print_model_init


!>------------------------------------------------
!! Initialize the model
!!
Expand Down
4 changes: 2 additions & 2 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ $(BUILD)test_sort.o: tests/test_sort.f90 $(BUILD)sorting.o
$(BUILD)test_qm.o: tests/test_qm.f90 $(BUILD)data_structures.o $(BUILD)quantile_mapping.o $(BUILD)basic_stats.o
$(FC) $(FCFLAGS) -c $< $(MODOUTPUT) -o $@

$(BUILD)test_config.o: tests/test_config.f90 $(BUILD)data_structures.o $(BUILD)model_constants.o $(BUILD)configuration.o $(BUILD)init.o
$(BUILD)test_config.o: tests/test_config.f90 $(BUILD)data_structures.o $(BUILD)model_constants.o $(BUILD)configuration.o
$(FC) $(FCFLAGS) -c $< $(MODOUTPUT) -o $@

$(BUILD)test_random.o: tests/test_random.f90 $(BUILD)random.o $(BUILD)model_constants.o
Expand Down Expand Up @@ -446,7 +446,7 @@ $(BUILD)io_routines.o: io/io_routines.f90 $(BUILD)model_constants.o
$(FC) $(FCFLAGS) -c $< $(MODOUTPUT) -o $@

$(BUILD)configuration.o: config/configuration.f90 $(BUILD)data_structures.o $(BUILD)model_constants.o \
$(BUILD)string.o $(BUILD)io_routines.o $(BUILD)time.o $(BUILD)init.o
$(BUILD)string.o $(BUILD)io_routines.o $(BUILD)time.o
$(FC) $(FCFLAGS) -c $< $(MODOUTPUT) -o $@

$(BUILD)geo_reader.o: utilities/geo_reader.f90 $(BUILD)data_structures.o $(BUILD)model_constants.o
Expand Down

0 comments on commit 8f80e1d

Please sign in to comment.