Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement/runtime pft count #189

Merged
merged 119 commits into from
Sep 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
5ec676b
num_*_forcing_fields not needed in marbl_sizes.F90
mnlevy1981 Jul 10, 2017
fde5862
tracer_restore_cnt not needed in marbl_sizes.F90
mnlevy1981 Jul 10, 2017
1a0b842
Rename initialization routines
mnlevy1981 Jul 13, 2017
6afefd0
Introduced marbl%init subroutine
mnlevy1981 Jul 13, 2017
b6c9a22
Tracer counts are runtime configurable
mnlevy1981 Jul 13, 2017
14efae6
Add tracer count consistency check
mnlevy1981 Jul 13, 2017
9ee2746
Rename initialization phases
mnlevy1981 Jul 17, 2017
624add8
forcing index constructor doesn't need tracer cnt
mnlevy1981 Jul 17, 2017
c54bcbd
use local var not associate for total tracer cnt
mnlevy1981 Jul 17, 2017
6797efc
Rename marbl_total_tracer_cnt
mnlevy1981 Jul 17, 2017
7a2eb84
Allocate memory for tracer_restore_vars in phase2
mnlevy1981 Jul 17, 2017
53f36af
Clean up how tracer index type is initialized
mnlevy1981 Jul 17, 2017
62d143c
Reorder arguments in init()
mnlevy1981 Jul 18, 2017
66c7bfb
Add error-checking to tracer_index_constructor
mnlevy1981 Jul 18, 2017
b208360
Rename init_phase# routines
mnlevy1981 Jul 19, 2017
3bfd722
remove un-necessary consistency check
mnlevy1981 Jul 19, 2017
1a4fc05
marbl_tracer_cnt is set in index constructor
mnlevy1981 Jul 20, 2017
d9dcf5c
Refactor how forcing fields are initialized
mnlevy1981 Jul 20, 2017
ed5d483
Introduce marbl_init_mod for initialization
mnlevy1981 Jul 26, 2017
2d23ead
Forgot to update subname parm in new module
mnlevy1981 Jul 26, 2017
358a63b
Introduce new routines in marbl_init
mnlevy1981 Jul 26, 2017
f743edf
Introduce more routines in marbl_init
mnlevy1981 Jul 26, 2017
24b9a9e
One more new marbl_init_mod routine
mnlevy1981 Jul 26, 2017
cfa80a3
Remove redundant forcing log messages
mnlevy1981 Jul 26, 2017
a4ced4f
remove ciso_on dependency in define_parameters
mnlevy1981 Jul 27, 2017
c4f4e60
Move marbl_config_nml to marbl_parms.F90
mnlevy1981 Jul 27, 2017
5422bb4
Use linked list for parameters, not reallocatable
mnlevy1981 Jul 27, 2017
0a24fdc
Update how put() calls work
mnlevy1981 Jul 27, 2017
78aca0a
0a24fdc broke the build
mnlevy1981 Jul 28, 2017
80ff23d
Some post-review cleanup
mnlevy1981 Jul 28, 2017
fa19d40
Update how "put()" works for parameters
mnlevy1981 Jul 31, 2017
b2eab0d
Reinstate error checking in put() calls
mnlevy1981 Jul 31, 2017
19f2fd6
gcm_nl_buffer is optional in init
mnlevy1981 Jul 31, 2017
c21d902
get_put test was seg-faulting, now error is logged
mnlevy1981 Jul 31, 2017
7cbf88b
Reintroduce parameters%cnt and set up array of ptr
mnlevy1981 Jul 31, 2017
1375c3b
Remove init_phase*
mnlevy1981 Jul 31, 2017
2ff0733
No need to split init_config/parms in two
mnlevy1981 Jul 31, 2017
55befe2
rename two config datatypes
mnlevy1981 Jul 31, 2017
6cb9dcd
Combine configuration and parameters into settings
mnlevy1981 Jul 31, 2017
2ea1ce2
First step to removing namelist
mnlevy1981 Jul 31, 2017
66427b2
Make marbl_interface%settings private
mnlevy1981 Jul 31, 2017
c6027aa
Clean up interface with marbl_settings_type
mnlevy1981 Aug 1, 2017
807000f
Introduced "input file" to replace namelist
mnlevy1981 Aug 1, 2017
9485bdf
Improve input file parsing
mnlevy1981 Aug 3, 2017
b62cf0c
Updates following hobart testing
mnlevy1981 Aug 3, 2017
87c80ad
Better error message when datatypes don't match
mnlevy1981 Aug 3, 2017
3893e3d
Add case-insensitive string compare function
mnlevy1981 Aug 3, 2017
a38a904
Bug in case insensitive comparison
mnlevy1981 Aug 3, 2017
05a82de
Remove marbl_namelist_mod
mnlevy1981 Aug 3, 2017
17faa16
Add array-handling to put_all_string()
mnlevy1981 Aug 3, 2017
7f8cc30
Better logic to check if str contains an integer
mnlevy1981 Aug 3, 2017
27d8837
Consistent logic when datatype = "integer"
mnlevy1981 Aug 3, 2017
6338c9d
remove more build-time config in favor of runtime
mnlevy1981 Aug 4, 2017
5a6fac9
Add third phase of setting parameters
mnlevy1981 Aug 4, 2017
c28527e
Bugfixes to keep stand-alone tests running
mnlevy1981 Aug 4, 2017
469ed18
Better thread safety on new module variables
mnlevy1981 Aug 7, 2017
a956c29
Some deallocation only when ciso_on = .true.
mnlevy1981 Aug 7, 2017
793b94e
Refactor logic to determine datatype from string
mnlevy1981 Aug 8, 2017
dc20eef
Inadvertant recursive call in put_string()
mnlevy1981 Aug 8, 2017
4d361d5
Rename marbl_init stand-alone driver module
mnlevy1981 Aug 9, 2017
5c463b4
Update when derived variables are computed
mnlevy1981 Aug 9, 2017
93bfdeb
Re-combined *_config_type and *_parms_type
mnlevy1981 Aug 9, 2017
f94381f
Reorganize parameter initialization
mnlevy1981 Aug 10, 2017
cf677a4
Clean-up while writing documentation
mnlevy1981 Aug 11, 2017
5330dd1
Update init() routine to reduce footprint
mnlevy1981 Aug 14, 2017
b0b2698
Better public routine names in marbl_parms.F90
mnlevy1981 Aug 14, 2017
2deb72f
Three small code clean-ups
mnlevy1981 Aug 15, 2017
10801ab
parse_inputfile_line() -> put_inputfile_line()
mnlevy1981 Aug 16, 2017
c5837f2
Clean up logic regarding which module to load
mnlevy1981 Aug 16, 2017
46c9479
Rename marbl_parms.F90 -> marbl_settings_mod.F90
mnlevy1981 Aug 17, 2017
4e7061b
Merge marbl_config_mod into marbl_settings_mod
mnlevy1981 Aug 17, 2017
758cc7c
Clean up marbl_settings_type
mnlevy1981 Aug 17, 2017
6b5a763
Clean up error messages in marbl_settings_mod
mnlevy1981 Aug 17, 2017
3cbe7cd
Clean up comments in marbl_setting_mod
mnlevy1981 Aug 17, 2017
08973bb
Error checking back in settings%get()
mnlevy1981 Aug 18, 2017
6587aa6
Add new format option for get_setting
mnlevy1981 Aug 18, 2017
47f4def
NAG doesn't like unit >= 100
mnlevy1981 Aug 18, 2017
6702c30
Destruct marbl_instance%settings in shutdown()
mnlevy1981 Aug 21, 2017
f0baf97
Better array parsing in puts; clearer comments
mnlevy1981 Aug 21, 2017
d9de76e
Add stdout to note when writing to file
mnlevy1981 Aug 21, 2017
d094621
Add MPI support for cheyenne testing
mnlevy1981 Aug 21, 2017
2fc674c
Clean up found when updating documentation
mnlevy1981 Aug 22, 2017
dcced58
Refactor how put_inputfile_line works
mnlevy1981 Aug 24, 2017
d051dcb
No longer need put_single_string()
mnlevy1981 Aug 24, 2017
47b1fc1
Deallocate all memory in shutdown()
mnlevy1981 Aug 24, 2017
afc55dd
Rename gen_inputfile/marbl.nml -> marbl_input.gen
mnlevy1981 Aug 24, 2017
bf5b305
Improve how driver parses input file
mnlevy1981 Aug 24, 2017
54c4c77
Argument to constructors should be intent(inout)
mnlevy1981 Aug 25, 2017
c7530a6
Cleaning up more intent(inout) -> intent(out)
mnlevy1981 Aug 25, 2017
adef436
auto_ind, zoo_ind allocated in grazing constructor
mnlevy1981 Aug 28, 2017
dc35b18
Re-organize when parameters are defined
mnlevy1981 Aug 28, 2017
5aca466
Add new test to run init twice
mnlevy1981 Aug 29, 2017
cb07ff8
Clean up comments about how to set parameters
mnlevy1981 Aug 29, 2017
bd67112
Clearer comments in marbl_settings_mod
mnlevy1981 Aug 29, 2017
10f6cba
Rename grazer_prey_cnt -> max_grazer_prey_cnt
mnlevy1981 Aug 30, 2017
dd50e95
Remove marbl_sizes.F90
mnlevy1981 Aug 30, 2017
924369c
terrible workaround for a PGI bug
mnlevy1981 Aug 30, 2017
71f7af7
Update how PFTs are initialized
mnlevy1981 Aug 30, 2017
253f84b
Code clean-up
mnlevy1981 Aug 31, 2017
1e8d2d3
Rename the modules containing interface types
mnlevy1981 Aug 31, 2017
69b3cdf
Update comments / declaration of PFT cnt vars
mnlevy1981 Aug 31, 2017
b7369a6
Add CESM-specific comments re: changing parm vals
mnlevy1981 Aug 31, 2017
63dad4f
Refactor put_inputfile_line
mnlevy1981 Sep 1, 2017
7305c10
Move linear_root to marbl_utils_mod
mnlevy1981 Sep 2, 2017
5f24451
First pass at unit tests for linear_root
mnlevy1981 Sep 2, 2017
3220c93
Add unit test for str_to_array()
mnlevy1981 Sep 2, 2017
915ed17
Refactor str_to_array unit test
mnlevy1981 Sep 2, 2017
75a0739
refactor linear_root unit test
mnlevy1981 Sep 2, 2017
3a1cc1f
Added three more linear_root tests
mnlevy1981 Sep 2, 2017
d8ec7bb
improve unit testing
mnlevy1981 Sep 5, 2017
6ed6690
Ignore leading white space in variable names
mnlevy1981 Sep 7, 2017
8be764e
Remove dependence on ieee_arithmetic
mnlevy1981 Sep 7, 2017
d280a45
Use older gnu compiler on hobart
mnlevy1981 Sep 7, 2017
7a4d819
Update nag compile flags
mnlevy1981 Sep 7, 2017
eab90c3
Code clean-up following review
mnlevy1981 Sep 11, 2017
5df66de
X -> 1X in formatting string
mnlevy1981 Sep 11, 2017
9377e22
Clearer unit test pass messages
mnlevy1981 Sep 11, 2017
3d5c0b4
Update formatting in unit testing for marbl_utils
mnlevy1981 Sep 11, 2017
a42bf26
One more formatting update
mnlevy1981 Sep 11, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ MODS = $(addprefix $(OBJ_DIR)/,${MODS_TMP:.F90=.mod}) \
$(INCS)
OBJS = $(addprefix $(OBJ_DIR)/,${MODULES:.F90=.o})

CPPDEFS=-DECOSYS_BASE_NT=32 -DZOOPLANKTON_CNT=1 -DAUTOTROPH_CNT=3 -DGRAZER_PREY_CNT=3
CPPDEFS=

ifeq ($(USEMPI),TRUE)
CPPDEFS+= -DMARBL_TIMING_OPT=MPI
Expand Down
165 changes: 68 additions & 97 deletions src/marbl_ciso_mod.F90

Large diffs are not rendered by default.

1,300 changes: 0 additions & 1,300 deletions src/marbl_config_mod.F90

This file was deleted.

625 changes: 363 additions & 262 deletions src/marbl_diagnostics_mod.F90

Large diffs are not rendered by default.

1,013 changes: 1,013 additions & 0 deletions src/marbl_init_mod.F90

Large diffs are not rendered by default.

882 changes: 542 additions & 340 deletions src/marbl_interface.F90

Large diffs are not rendered by default.

688 changes: 304 additions & 384 deletions src/marbl_internal_types.F90 → src/marbl_interface_private_types.F90

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module marbl_interface_types
module marbl_interface_public_types
! module for definitions of types that are shared between marbl interior and the driver.

use marbl_kinds_mod , only : r8, log_kind, int_kind, char_len
Expand Down Expand Up @@ -63,6 +63,7 @@ module marbl_interface_types
real(r8), allocatable :: delta_z(:) ! (km) delta z - different values for partial bottom cells
contains
procedure, public :: construct => marbl_domain_constructor
procedure, public :: destruct => marbl_domain_destructor
end type marbl_domain_type

!*****************************************************************************
Expand Down Expand Up @@ -203,14 +204,14 @@ subroutine marbl_domain_constructor(this, &
num_elements_surface_forcing, num_elements_interior_forcing, &
delta_z, zw, zt)

class(marbl_domain_type), intent(inout) :: this
integer (int_kind) , intent(in) :: num_levels
integer (int_kind) , intent(in) :: num_PAR_subcols
integer (int_kind) , intent(in) :: num_elements_surface_forcing
integer (int_kind) , intent(in) :: num_elements_interior_forcing
real (r8) , intent(in) :: delta_z(num_levels)
real (r8) , intent(in) :: zw(num_levels)
real (r8) , intent(in) :: zt(num_levels)
class(marbl_domain_type), intent(out) :: this
integer (int_kind), intent(in) :: num_levels
integer (int_kind), intent(in) :: num_PAR_subcols
integer (int_kind), intent(in) :: num_elements_surface_forcing
integer (int_kind), intent(in) :: num_elements_interior_forcing
real (r8), intent(in) :: delta_z(num_levels)
real (r8), intent(in) :: zw(num_levels)
real (r8), intent(in) :: zt(num_levels)

integer :: k

Expand All @@ -233,6 +234,20 @@ end subroutine marbl_domain_constructor

!*****************************************************************************

subroutine marbl_domain_destructor(this)

class(marbl_domain_type), intent(inout) :: this

if (allocated(this%delta_z)) then
deallocate(this%delta_z)
deallocate(this%zw)
deallocate(this%zt)
end if

end subroutine marbl_domain_destructor

!*****************************************************************************

subroutine marbl_single_saved_state_construct(this, lname, sname, units, &
vgrid, rank, num_elements, num_levels, marbl_status_log)

Expand All @@ -248,7 +263,7 @@ subroutine marbl_single_saved_state_construct(this, lname, sname, units, &
integer, intent(in) :: num_levels

character(len=*), parameter :: subname = &
'marbl_interface_types:marbl_single_saved_state_construct'
'marbl_interface_public_types:marbl_single_saved_state_construct'
character(len=char_len) :: log_message

select case (rank)
Expand Down Expand Up @@ -290,9 +305,9 @@ end subroutine marbl_single_saved_state_construct

subroutine marbl_saved_state_constructor(this, num_elements, num_levels)

class(marbl_saved_state_type), intent(inout) :: this
integer (int_kind) , intent(in) :: num_elements
integer (int_kind) , intent(in) :: num_levels
class(marbl_saved_state_type), intent(out) :: this
integer (int_kind), intent(in) :: num_elements
integer (int_kind), intent(in) :: num_levels

this%saved_state_cnt = 0
this%num_elements = num_elements
Expand All @@ -316,7 +331,7 @@ subroutine marbl_saved_state_add(this, lname, sname, units, vgrid, rank, &
integer(int_kind), intent(in) :: rank
integer(int_kind), intent(out) :: id

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_saved_state_add'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_saved_state_add'
character(len=char_len) :: log_message

type(marbl_single_saved_state_type), dimension(:), pointer :: new_state
Expand Down Expand Up @@ -383,7 +398,7 @@ subroutine marbl_single_diag_init(this, lname, sname, units, vgrid, &
integer , intent(in) :: num_levels
type(marbl_log_type) , intent(inout) :: marbl_status_log

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_single_diag_init'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_single_diag_init'
character(len=char_len) :: log_message

! Allocate column memory for 3D vars or num_elements memory for 2D vars
Expand Down Expand Up @@ -414,13 +429,14 @@ end subroutine marbl_single_diag_init

subroutine marbl_single_sfo_constructor(this, num_elements, field_name, id, &
marbl_status_log)
class(marbl_single_sfo_type), intent(inout) :: this

class(marbl_single_sfo_type), intent(out) :: this
character(len=*), intent(in) :: field_name
integer(int_kind), intent(in) :: num_elements
integer(int_kind), intent(in) :: id
type(marbl_log_type), intent(inout) :: marbl_status_log

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_single_sfo_constructor'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_single_sfo_constructor'
character(len=char_len) :: log_message

select case (trim(field_name))
Expand Down Expand Up @@ -483,7 +499,7 @@ subroutine marbl_sfo_add(this, num_elements, field_name, sfo_id, &
type(marbl_log_type), intent(inout) :: marbl_status_log
integer(int_kind), intent(out) :: sfo_id

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_sfo_add'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_sfo_add'

type(marbl_single_sfo_type), dimension(:), pointer :: new_sfo
integer :: n, old_size
Expand Down Expand Up @@ -531,9 +547,9 @@ end subroutine marbl_sfo_add

subroutine marbl_diagnostics_constructor(this, num_elements, num_levels)

class(marbl_diagnostics_type), intent(inout) :: this
integer (int_kind), intent(in) :: num_elements
integer (int_kind), intent(in) :: num_levels
class(marbl_diagnostics_type), intent(out) :: this
integer (int_kind), intent(in) :: num_elements
integer (int_kind), intent(in) :: num_levels

allocate(this%diags(0))
this%num_elements = num_elements
Expand All @@ -548,7 +564,7 @@ subroutine marbl_diagnostics_set_to_zero(this, marbl_status_log)
class(marbl_diagnostics_type), intent(inout) :: this
type(marbl_log_type), intent(inout) :: marbl_status_log

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_diagnostics_set_to_zero'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_diagnostics_set_to_zero'
character(len=char_len) :: log_message

integer (int_kind) :: n
Expand Down Expand Up @@ -582,7 +598,7 @@ subroutine marbl_diagnostics_add(this, lname, sname, units, vgrid, &
integer (int_kind) , intent(out) :: id
type(marbl_log_type) , intent(inout) :: marbl_status_log

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_diagnostics_add'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_diagnostics_add'
character(len=char_len) :: log_message

type(marbl_single_diagnostic_type), dimension(:), pointer :: new_diags
Expand Down Expand Up @@ -669,7 +685,7 @@ subroutine marbl_forcing_fields_set_rank(this, num_elements, rank, &
type(marbl_log_type), intent(inout) :: marbl_status_log
integer, optional, intent(in) :: dim1

character(len=*), parameter :: subname = 'marbl_interface_types:marbl_forcing_fields_set_rank'
character(len=*), parameter :: subname = 'marbl_interface_public_types:marbl_forcing_fields_set_rank'
character(len=char_len) :: log_message

this%metadata%rank = rank
Expand All @@ -696,8 +712,8 @@ end subroutine marbl_forcing_fields_set_rank

subroutine marbl_timers_constructor(this, num_timers)

class(marbl_timers_type), intent(inout) :: this
integer, intent(in) :: num_timers
class(marbl_timers_type), intent(out) :: this
integer, intent(in) :: num_timers

this%num_timers = num_timers
allocate(this%names(num_timers))
Expand Down Expand Up @@ -729,4 +745,4 @@ end subroutine marbl_timers_deconstructor

!*****************************************************************************

end module marbl_interface_types
end module marbl_interface_public_types
6 changes: 4 additions & 2 deletions src/marbl_logging.F90
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ module marbl_logging
!****************************************************************************

type, public :: marbl_log_type
logical, public :: labort_marbl ! True => driver should abort GCM
logical, private :: lconstructed = .false. ! True => constructor was already called
logical, public :: labort_marbl = .false. ! True => driver should abort GCM
type(marbl_log_output_options_type) :: OutputOptions
type(marbl_status_log_entry_type), pointer :: FullLog
type(marbl_status_log_entry_type), pointer :: LastEntry
Expand Down Expand Up @@ -172,7 +173,8 @@ subroutine marbl_log_constructor(this)

class(marbl_log_type), intent(inout) :: this

this%labort_marbl = .false.
if (this%lconstructed) return
this%lconstructed = .true.
nullify(this%FullLog)
nullify(this%LastEntry)
call this%OutputOptions%construct()
Expand Down
Loading