Fields 'x' and 'y' in 'output.init.nc'

Hello!

Perhaps I did not understand everything, but I have to deal with my problems.
In NEMO v4.2 the files ‘output.init.nc’, ‘mesh_mask.nc’, ‘output.abort.nc’ and obviously others that are not output by XIOS have ‘x’ and ‘y’ fields with a dimension of two. These names are the same as the names of the ‘x’ and ‘y’ dimensions. In this case, the program ‘Panoply’ (netcdf viewer) cannot display 2D fields. I made the following changes in iom_nf90.F90 code between lines 573 and 583

!            CALL iom_nf90_check(NF90_DEF_VAR( if90id, TRIM(iom_file(kiomid)%cn_var(jd)), NF90_FLOAT , (/ 1, 2 /),   &
!               &                              iom_file(kiomid)%nvid(jd) ), clinfo)
      if (jd == 1) then
        CALL iom_nf90_check(NF90_DEF_VAR( if90id, 'xm', NF90_FLOAT , (/ 1, 2 /), iom_file(kiomid)%nvid(jd) ), clinfo)
      else
        CALL iom_nf90_check(NF90_DEF_VAR( if90id, 'ym', NF90_FLOAT , (/ 1, 2 /), iom_file(kiomid)%nvid(jd) ), clinfo)
      end if

Or it can be made as

!            CALL iom_nf90_check(NF90_DEF_VAR( if90id, TRIM(iom_file(kiomid)%cn_var(jd)), NF90_FLOAT , (/ 1, 2 /),   &
!               &                              iom_file(kiomid)%nvid(jd) ), clinfo)
   CALL iom_nf90_check(NF90_DEF_VAR( if90id,  TRIM(iom_file(kiomid)%cn_var(jd)) // 'm', NF90_FLOAT , (/ 1, 2 /),     &
                &                              iom_file(kiomid)%nvid(jd) ), clinfo)

Is it right?

I would say yes for both suggestions.
You could also use ncrename to rename dimensions and/or variables once the files are written by NEMO.

Thanks

I use also python script for this

Sincery yours,
Boris Strukov