From 8f80e1d438498b7ac182dd3ada53908b734be441 Mon Sep 17 00:00:00 2001 From: Joe Hamman Date: Thu, 9 Mar 2017 22:06:03 -0800 Subject: [PATCH] move print_model_init to configuration.F90 --- src/config/configuration.f90 | 37 +++++++++++++++++++++++++++++++++-- src/main/init.f90 | 38 +----------------------------------- src/makefile | 4 ++-- 3 files changed, 38 insertions(+), 41 deletions(-) diff --git a/src/config/configuration.f90 b/src/config/configuration.f90 index a9a1dff..ddc4ad2 100644 --- a/src/config/configuration.f90 +++ b/src/config/configuration.f90 @@ -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 (gutmann@ucar.edu) @@ -12,7 +12,6 @@ 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 @@ -20,6 +19,7 @@ module config_mod 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 !>------------------------------------------------ @@ -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 diff --git a/src/main/init.f90 b/src/main/init.f90 index 8355f77..c49c878 100644 --- a/src/main/init.f90 +++ b/src/main/init.f90 @@ -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 !! diff --git a/src/makefile b/src/makefile index 553a81b..5525520 100644 --- a/src/makefile +++ b/src/makefile @@ -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 @@ -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