Skip to content

Commit 51359f2

Browse files
committed
cleanup
1 parent 9b8df13 commit 51359f2

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/ExchangeRegistrar.f90

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
!> @brief This module exposes a single higher-order routine whose purpose is to register an exchange with
2+
!! the simulation. The routine accepts procedure pointers to exchange-scoped registration routines. This
3+
!! could be done in ExchangeFactory (indeed, the latter maps exchange acronyms to registration routines),
4+
!! but we do registration here to keep ExchangeFactory minimal since editing template files is annoying.
15
module ExchangeRegistrarModule
26
use KindModule, only: I4B, LGP
37
use ConstantsModule, only: LINELENGTH
4-
use ListsModule, only: basemodellist
58
use SimVariablesModule, only: iout, model_names, model_loc_idx
69
use ArrayHandlersModule, only: ifind
710
use SimModule, only: store_error
@@ -46,6 +49,7 @@ subroutine register_virtual_exchange( &
4649

4750
contains
4851

52+
!> @brief Register an exchange with the simulation.
4953
subroutine register_exchange( &
5054
register_actual, &
5155
register_virtual, &
@@ -99,7 +103,8 @@ subroutine register_exchange( &
99103
' will be created to connect model ', model1_id, &
100104
' with model ', model2_id
101105

102-
! check if models are of the same type
106+
! check if models are the same type
107+
! todo: factor out a routine? can we expect exg name format to stay consistent?
103108
same_type = exchange_name(1:3) == exchange_name(5:7)
104109

105110
! an actual exchange should be registered if the models

src/ModelRegistrar.f90

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ subroutine register_model( &
6868
model_loc_idx(global_model_id) = model_id
6969
end if
7070

71-
! proc pointer will be null if the model doesn't support parallel
72-
if (associated(register_virtual)) &
73-
call register_virtual(global_model_id, model_name, model)
71+
call register_virtual(global_model_id, model_name, model)
7472

7573
end subroutine register_model
7674

0 commit comments

Comments
 (0)