-
Notifications
You must be signed in to change notification settings - Fork 136
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
Subaxis setup #1056
Subaxis setup #1056
Conversation
…o for the axis, adds subroutines that dumps the contents of each of the objects
endif | ||
diag_axis => this | ||
type is (fmsDiagSubAxis_type) | ||
sub_axis_name = this%subaxis_name//"_sub01" |
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.
Why is this "01"? Should these be numbered?
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.
Why isn't this just added to the subaxis name? It gets used in the write too.
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.
The "_01" is the convention from the previous diag manager, and PP tools expect it to have it.
but I am going to just add it to this%subaxis_name, not sure what i was thinking
lat(2) = maxval(corners(:,2)) | ||
end select | ||
|
||
if (is_cube_sphere) 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.
Can you label the if
s and do
s in this routine? There's a lot of them and they are large.
@@ -13,7 +13,7 @@ module fms_diag_field_object_mod | |||
use diag_data_mod, only: max_field_attributes, fmsDiagAttribute_type | |||
use diag_data_mod, only: diag_null, diag_not_found, diag_not_registered, diag_registered_id, & | |||
&DIAG_FIELD_NOT_FOUND | |||
use mpp_mod, only: fatal, note, warning, mpp_error, mpp_pe, mpp_root_pe | |||
use mpp_mod, only: fatal, note, warning, mpp_error, stdout, mpp_pe, mpp_root_pe |
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.
You added stdout
but I don't think it's used.
use mpp_mod, only: mpp_get_current_pelist, mpp_npes, mpp_root_pe, mpp_pe, mpp_error, FATAL, stdout | ||
use time_manager_mod, only: time_type, operator(/=), operator(==), date_to_string |
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.
This use statement is very similar to one above. Can you either combine it or move it with the other use time_manager_mod
@@ -613,9 +642,11 @@ subroutine dump_file_obj(this, unit_num) | |||
end subroutine | |||
|
|||
!< @brief Opens the diag_file if it is time to do so | |||
subroutine open_diag_file(this, time_step) | |||
subroutine open_diag_file(this, time_step, file_is_opened) |
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.
They're called history files, not diag files.
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.
lol we don't call them history files anywhere in the code ...
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.
touche
end subroutine open_diag_file | ||
|
||
!< @brief Writes the axis metadata for the file | ||
subroutine write_metadata(this, diag_axis) |
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.
Is this specific for an axis? If it is, it should be called write_axis_metadata
!TODO: closing the file here for now, just to see if it works | ||
call close_file(fileobj) |
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.
oh boy...
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.
This gets cleaned up in the next PR, once all of the time stuff is set up "correctly"
@@ -211,15 +211,15 @@ integer function fms_register_diag_field_obj & | |||
fileptr => this%FMS_diag_files(file_ids(i))%FMS_diag_file | |||
call fileptr%add_field_id(fieldptr%get_id()) | |||
call fileptr%set_file_domain(fieldptr%get_domain(), fieldptr%get_type_of_domain()) | |||
call fileptr%add_axes(axes) | |||
call fileptr%add_axes(axes, this%diag_axis, this%registered_axis) |
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.
Is axes
the id of the axis?
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.
axes is an array of ids of the axis
diag_manager/fms_diag_object.F90
Outdated
@@ -426,9 +427,16 @@ subroutine fms_diag_send_complete(this, time_step) | |||
#else | |||
class(fmsDiagFileContainer_type), pointer :: diag_file !< Pointer to this%FMS_diag_files(i) (for convenience) | |||
|
|||
logical :: file_is_opened !< True if the file was opened in this time_step |
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.
This variable should be named something like file_opened_this_time_step
so it's more descriptive.
@thomas-robinson I think this is ready for another round of review.. |
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.
Clean up the use
statement, then let me know when it's done and I will merge it.
@@ -29,14 +29,14 @@ module fms_diag_file_object_mod | |||
get_instance_filename, open_file, close_file, get_mosaic_tile_file | |||
use diag_data_mod, only: DIAG_NULL, NO_DOMAIN, max_axes, SUB_REGIONAL, get_base_time, DIAG_NOT_REGISTERED, & | |||
TWO_D_DOMAIN, UG_DOMAIN, prepend_date, DIAG_DAYS, VERY_LARGE_FILE_FREQ | |||
use time_manager_mod, only: time_type, operator(>), operator(/=), operator(==), get_date | |||
use time_manager_mod, only: time_type, operator(>), operator(/=), operator(==), get_date, & | |||
operator(/=), operator(==), date_to_string |
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.
you have the operator(/=), operator(==)
twice in this use statement
* Adds fms_diag_time_utils.F90 and copies get_time_string and diag_time_inc * Use diag_time_inc in the fileobj * finish setting up the io to open the file * Adds documentation, non-domain decomposed files now only get written by the root PE * set up the time for the next open and some bug fixes * Adds code to setups the subaxis * Fix bugs in the code that get the starting and ending index of the subregion * fixes bugs in the code that sets up the subaxis object, updates the io for the axis, adds subroutines that dumps the contents of each of the objects Co-authored-by: Uriel Ramirez <uriel.ramirez@noaa.gov>
* Adds fms_diag_time_utils.F90 and copies get_time_string and diag_time_inc * Use diag_time_inc in the fileobj * finish setting up the io to open the file * Adds documentation, non-domain decomposed files now only get written by the root PE * set up the time for the next open and some bug fixes * Adds code to setups the subaxis * Fix bugs in the code that get the starting and ending index of the subregion * fixes bugs in the code that sets up the subaxis object, updates the io for the axis, adds subroutines that dumps the contents of each of the objects Co-authored-by: Uriel Ramirez <uriel.ramirez@noaa.gov>
Description
Fixes # (issue)
How Has This Been Tested?
CI
Checklist:
make distcheck
passes