diff --git a/src/framework/MOM_diag_mediator.F90 b/src/framework/MOM_diag_mediator.F90 index 905f5d21b2..8b354b00ca 100644 --- a/src/framework/MOM_diag_mediator.F90 +++ b/src/framework/MOM_diag_mediator.F90 @@ -806,15 +806,19 @@ function register_diag_field(module_name, field_name, axes, init_time, & diag_cs => axes%diag_cs primary_id = DIAG_FIELD_NOT_FOUND - diag => null() do i=1,size(vertical_coords) if (vertical_coord_strings(i) /= 'LAYER') then + ! For now we don't support remapping diagnostics onto interfaces. + if (is_interface_axis(diag_cs, axes)) then + cycle + endif new_module_name = trim(module_name//'_'//lowercase(trim(vertical_coord_strings(i)))) else new_module_name = module_name endif + diag => null() if (get_diag_field_id_fms(new_module_name, field_name) /= DIAG_FIELD_NOT_FOUND) then if (primary_id == DIAG_FIELD_NOT_FOUND) then primary_id = get_new_primary_diag_id(diag_cs) @@ -841,12 +845,15 @@ function register_diag_field(module_name, field_name, axes, init_time, & 'register_diag_field: Could not register diag') diag%fms_diag_id = fms_id - if (is_root_pe() .and. diag_CS%doc_unit > 0) then - msg = '' - if (present(cmor_field_name)) msg = 'CMOR equivalent is "'//trim(cmor_field_name)//'"' - call log_available_diag(associated(diag), module_name, field_name, cm_string, & - msg, diag_CS, long_name, units, standard_name) - endif + endif + ! This diag is being registered, so it is available. + print*, 'registering ', new_module_name, field_name + if (is_root_pe() .and. diag_CS%doc_unit > 0) then + msg = '' + print*, 'calling log_available_diag' + if (present(cmor_field_name)) msg = 'CMOR equivalent is "'//trim(cmor_field_name)//'"' + call log_available_diag(associated(diag), new_module_name, field_name, cm_string, & + msg, diag_CS, long_name, units, standard_name) endif if (.not. present(cmor_field_name)) then @@ -854,6 +861,7 @@ function register_diag_field(module_name, field_name, axes, init_time, & endif ! Set up the CMOR variation of the native diagnostic + diag => null() if (get_diag_field_id_fms(new_module_name, cmor_field_name) /= DIAG_FIELD_NOT_FOUND) then ! Fallback values for strings set to "NULL" ! Values might be able to be replaced with a CS%missing field? @@ -898,12 +906,12 @@ function register_diag_field(module_name, field_name, axes, init_time, & 'register_diag_field: Could not register diag') diag%fms_diag_id = fms_id - if (is_root_pe() .and. diag_CS%doc_unit > 0) then - msg = 'native name is "'//trim(field_name)//'"' - call log_available_diag(associated(diag), module_name, cmor_field_name, cm_string, & - msg, diag_CS, posted_cmor_long_name, posted_cmor_units, & - posted_cmor_standard_name) - endif + endif + if (is_root_pe() .and. diag_CS%doc_unit > 0) then + msg = 'native name is "'//trim(field_name)//'"' + call log_available_diag(associated(diag), new_module_name, cmor_field_name, cm_string, & + msg, diag_CS, posted_cmor_long_name, posted_cmor_units, & + posted_cmor_standard_name) endif enddo @@ -1624,6 +1632,28 @@ subroutine set_diag_mask_and_axes(diag, diag_cs, axes) end subroutine set_diag_mask_and_axes +function is_interface_axis(diag_cs, axes) + type(diag_ctrl), target, intent(in) :: diag_cs + type(axes_grp), intent(in) :: axes + + logical :: is_interface_axis + + is_interface_axis = .false. + + if (axes%rank .eq. 3) then + if ((axes%id .eq. diag_cs%axesTi%id)) then + is_interface_axis = .true. + elseif(axes%id .eq. diag_cs%axesBi%id) then + is_interface_axis = .true. + elseif(axes%id .eq. diag_cs%axesCui%id ) then + is_interface_axis = .true. + elseif(axes%id .eq. diag_cs%axesCvi%id) then + is_interface_axis = .true. + endif + endif + +end function is_interface_axis + ! Allocate a new diagnostic id, it may be necessary to expand the diagnostics ! array. function get_new_primary_diag_id(diag_cs)