Skip to content

Commit 61995cb

Browse files
committed
+Revise MOM_IceShelf available diags file format
Revised the MOM_ice_shelf_diag_mediator code that creates the MOM_IceShelf.available_diags file to follow the same pattern of logging as the rest of MOM6. The specific changes include moving the module name(s) to their own line, adding static diagnostics to the variables that are logged in the available_diags file (however, the ice shelf code does not have any static diagnostics yet), logging the axes of the diagnostic, and adding cell metrics to describe how a diagnostic might be reduced and logging these as well. All solutions are bitwise identical, but there are new entries and added information in the MOM_IceShelf.available_diags files.
1 parent 85a4cd7 commit 61995cb

1 file changed

Lines changed: 16 additions & 30 deletions

File tree

src/ice_shelf/MOM_ice_shelf_diag_mediator.F90

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,8 @@ function register_MOM_IS_diag_field(module_name, field_name, axes_in, init_time,
716716
type(diag_ctrl), pointer :: diag_cs => NULL() ! A structure that is used to regulate diagnostic output
717717
type(axes_grp), pointer :: axes
718718
integer :: dm_id
719-
character(len=256) :: msg, cm_string
719+
character(len=256) :: msg
720+
character(len=256) :: cm_string ! A string describing the cell methods returned from attach_cell_methods.
720721
character(len=256) :: new_module_name
721722
character(len=480) :: module_list, var_list
722723
character(len=24) :: dimensions
@@ -776,9 +777,7 @@ function register_MOM_IS_diag_field(module_name, field_name, axes_in, init_time,
776777
if (is_root_pe() .and. (diag_CS%available_diag_doc_unit > 0)) then
777778
msg = ''
778779
if (present(cmor_field_name)) msg = 'CMOR equivalent is "'//trim(cmor_field_name)//'"'
779-
cm_string = ''
780-
!### Uncoment this to add cell methods:
781-
! call attach_cell_methods(-1, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
780+
call attach_cell_methods(-1, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
782781
module_list = trim(module_list)//"}"
783782
if (num_modnm <= 1) module_list = module_name
784783
if (num_varnm <= 1) var_list = ''
@@ -840,7 +839,8 @@ logical function register_diag_field_expand_cmor(dm_id, module_name, field_name,
840839
type(diag_ctrl), pointer :: diag_cs => null()
841840
type(diag_type), pointer :: this_diag => null()
842841
integer :: fms_id
843-
character(len=256) :: posted_cmor_units, posted_cmor_standard_name, posted_cmor_long_name, cm_string
842+
character(len=256) :: posted_cmor_units, posted_cmor_standard_name, posted_cmor_long_name
843+
character(len=256) :: cm_string ! A string describing the cell methods returned from attach_cell_methods.
844844

845845
MOM_missing_value = axes%diag_cs%missing_value
846846
if (present(missing_value)) MOM_missing_value = missing_value
@@ -855,9 +855,7 @@ logical function register_diag_field_expand_cmor(dm_id, module_name, field_name,
855855
verbose=verbose, do_not_log=do_not_log, err_msg=err_msg, &
856856
interp_method=interp_method, tile_count=tile_count)
857857
if (.not. diag_cs%diag_as_chksum) &
858-
cm_string = ''
859-
!### Uncoment this to add cell methods:
860-
! call attach_cell_methods(fms_id, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
858+
call attach_cell_methods(fms_id, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
861859

862860
this_diag => null()
863861
if (fms_id /= DIAG_FIELD_NOT_FOUND) then
@@ -889,9 +887,7 @@ logical function register_diag_field_expand_cmor(dm_id, module_name, field_name,
889887
missing_value=MOM_missing_value, range=range, mask_variant=mask_variant, &
890888
standard_name=trim(posted_cmor_standard_name), verbose=verbose, do_not_log=do_not_log, &
891889
err_msg=err_msg, interp_method=interp_method, tile_count=tile_count)
892-
cm_string = ''
893-
!### Uncoment this to add cell methods:
894-
! call attach_cell_methods(fms_id, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
890+
call attach_cell_methods(fms_id, axes, cm_string, cell_methods, x_cell_method, y_cell_method)
895891

896892
this_diag => null()
897893
if (fms_id /= DIAG_FIELD_NOT_FOUND) then
@@ -1379,8 +1375,7 @@ function register_MOM_IS_static_field(module_name, field_name, axes, &
13791375
if (len_trim(dimensions) > 0) dimensions = trim_trailing_commas(dimensions)
13801376

13811377
! Document diagnostics in list of available diagnostics
1382-
!### if (is_root_pe() .and. diag_CS%available_diag_doc_unit > 0) then
1383-
if (is_root_pe() .and. .false.) then ! Replace this to work like MOM6.
1378+
if (is_root_pe() .and. diag_CS%available_diag_doc_unit > 0) then
13841379
if (present(cmor_field_name)) then
13851380
call log_available_diag(associated(diag), module_name, field_name, '', '', diag_CS, &
13861381
long_name, units, standard_name, &
@@ -1729,34 +1724,25 @@ subroutine log_available_diag(used, module_name, field_name, cell_methods_string
17291724
character(len=240) :: mesg
17301725

17311726
if (used) then
1732-
mesg = '"'//trim(module_name)//'", "'//trim(field_name)//'" [Used]'
1727+
mesg = '"'//trim(field_name)//'" [Used]'
17331728
else
1734-
mesg = '"'//trim(module_name)//'", "'//trim(field_name)//'" [Unused]'
1729+
mesg = '"'//trim(field_name)//'" [Unused]'
17351730
endif
1736-
!### This form of output agrees with MOM_diag_manager:
1737-
! if (used) then
1738-
! mesg = '"'//trim(field_name)//'" [Used]'
1739-
! else
1740-
! mesg = '"'//trim(field_name)//'" [Unused]'
1741-
! endif
17421731
if (len(trim((comment)))>0) then
17431732
write(diag_CS%available_diag_doc_unit, '(a,1x,"(",a,")")') trim(mesg),trim(comment)
17441733
else
17451734
write(diag_CS%available_diag_doc_unit, '(a)') trim(mesg)
17461735
endif
1747-
!### These should be uncommented later to align with MOM_diag_manager:
1748-
! call describe_option("modules", module_name, diag_CS)
1749-
! if (present(dimensions)) then
1750-
! if (len(trim(dimensions)) > 0) then
1751-
! call describe_option("dimensions", dimensions, diag_CS)
1752-
! endif
1753-
! endif
1736+
call describe_option("modules", module_name, diag_CS)
1737+
if (present(dimensions)) then ; if (len(trim(dimensions)) > 0) then
1738+
call describe_option("dimensions", dimensions, diag_CS)
1739+
endif ; endif
17541740
if (present(long_name)) call describe_option("long_name", long_name, diag_CS)
17551741
if (present(units)) call describe_option("units", units, diag_CS)
17561742
if (present(standard_name)) &
17571743
call describe_option("standard_name", standard_name, diag_CS)
1758-
! if (len(trim((cell_methods_string)))>0) &
1759-
! call describe_option("cell_methods", trim(cell_methods_string), diag_CS)
1744+
if (len(trim((cell_methods_string)))>0) &
1745+
call describe_option("cell_methods", trim(cell_methods_string), diag_CS)
17601746
if (present(variants)) then ; if (len(trim(variants)) > 0) then
17611747
call describe_option("variants", variants, diag_CS)
17621748
endif ; endif

0 commit comments

Comments
 (0)