-
Notifications
You must be signed in to change notification settings - Fork 14
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
Physics tendency updaters #163
Changes from 11 commits
d3a66a3
fc57eda
4de55c2
caa3f2f
d394909
5e26b26
e6ff6fe
72e25d0
e5b2fd2
21a6bf8
c004ddd
7490848
349c6e5
9907a1f
e588cf5
b4e1bc1
51fbada
7adab47
b8fe050
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ module cam_abortutils | |
type(open_file_pointer), pointer :: open_files_tail => NULL() | ||
type(open_file_pointer), pointer :: open_files_pool => NULL() | ||
|
||
private :: active_file_ptr | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure what is going on here but this might be a regression. I think the 'base' version is a fix that @nusbaume put in recently. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good call - reverted. |
||
CONTAINS | ||
|
||
subroutine check_allocate(errcode, subname, fieldname, file, line) | ||
|
@@ -95,6 +97,21 @@ subroutine cam_register_open_file(file, file_name) | |
end if | ||
end subroutine cam_register_open_file | ||
|
||
logical function active_file_ptr(of_ptr) | ||
! Return .true. iff <of_ptr> is associated and its <file_desc> member | ||
! is also associated | ||
! Dummy argument | ||
type(open_file_pointer), pointer, intent(in) :: of_ptr | ||
|
||
active_file_ptr = .false. | ||
if (associated(of_ptr)) then | ||
if (associated(of_ptr%file_desc)) then | ||
active_file_ptr = .true. | ||
end if | ||
end if | ||
|
||
end function active_file_ptr | ||
|
||
subroutine cam_register_close_file(file, log_shutdown_in) | ||
! Dummy arguments | ||
type(file_desc_t), target, intent(in) :: file | ||
|
@@ -115,16 +132,7 @@ subroutine cam_register_close_file(file, log_shutdown_in) | |
end if | ||
! Look to see if we have this file | ||
of_ptr => open_files_head | ||
|
||
!Set while-loop control variable | ||
file_loop_var = .false. | ||
if (associated(of_ptr)) then | ||
if(associated(of_ptr%file_desc)) then | ||
file_loop_var = .true. | ||
end if | ||
end if | ||
|
||
do while (file_loop_var) | ||
do while (active_file_ptr(of_ptr)) | ||
if (file%fh == of_ptr%file_desc%fh) then | ||
! Remove this file from the list | ||
if (associated(of_prev)) then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not super happy with explicitly calling out the class hierarchy. Not that I have a plan to change this one but changing it is more difficult if we put explicit names in derived classes. Is there a good reason to not use
super
(here and below)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was getting errors using
super
- I think related to a python version change.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I think this is probably due to taking out the
(object)
inheritance in the classes.Since we do not use multiple inheritance, you should be able to just use
super()
in place ofVarBase
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To get that to work, I think I have to change
class VarBase
toclass VarBase(object)
. Does that seem right?