when I need FMS2 to do the data override for your input files, the compiling failed. When FMS2 compiler is used for "-DUSE_FMS2_IO", the icebergs_fms2io.F90 needs register_unlimited_compressed_axis while in the FMS2 source code, the declaration and subroutine for this is missing, make the compiling failed.
The following is my solution (I can of course make a pull request for this only if necessary):
You will need to add src/FMS2/fms2_io/fms2_io.F90 at around line 55:
public :: register_unlimited_compressed_axis
And add src/FMS2/fms2_io/netcdf_io.F90:
public :: register_unlimited_compressed_axis
subroutine register_unlimited_compressed_axis(fileobj, dimension_name, dimension_length)
class(FmsNetcdfFile_t), intent(inout) :: fileobj !< File object.
character(len=*), intent(in) :: dimension_name !< Dimension name.
integer, intent(in) :: dimension_length !< Dimension length for the current rank
integer, dimension(:), allocatable :: npes_start !< The starting index of the dimension for each of the PEs
integer, dimension(:), allocatable :: npes_count !< The size of the dimension for each of the PEs
integer :: i !< For do loops
integer :: err !< Netcdf error
integer :: dimid !< Netcdf id for the dimension
!Gather all local dimension lengths on the I/O root pe.
allocate(npes_start(size(fileobj%pelist)))
allocate(npes_count(size(fileobj%pelist)))
call mpp_gather((/dimension_length/),npes_count,pelist=fileobj%pelist)
npes_start(1) = 1
do i = 1, size(fileobj%pelist)-1
npes_start(i+1) = npes_start(i) + npes_count(i)
enddo
call append_compressed_dimension(fileobj, dimension_name, npes_start, &
npes_count)
if (fileobj%is_root .and. .not. fileobj%is_readonly) then
call set_netcdf_mode(fileobj%ncid, define_mode)
err = nf90_def_dim(fileobj%ncid, trim(dimension_name), unlimited, dimid)
call check_netcdf_code(err, "Netcdf_add_dimension: file:"//trim(fileobj%path)//" dimension name:"// &
& trim(dimension_name))
endif
end subroutine register_unlimited_compressed_axis
After making this changes, recompile FMS, with FMS linked to FMS2 instead of FMS1.
This way, it will allow you to compile for the ocean_SIS2 with FMS2.
when I need FMS2 to do the data override for your input files, the compiling failed. When FMS2 compiler is used for "-DUSE_FMS2_IO", the icebergs_fms2io.F90 needs register_unlimited_compressed_axis while in the FMS2 source code, the declaration and subroutine for this is missing, make the compiling failed.
The following is my solution (I can of course make a pull request for this only if necessary):
You will need to add src/FMS2/fms2_io/fms2_io.F90 at around line 55:
public :: register_unlimited_compressed_axis
And add src/FMS2/fms2_io/netcdf_io.F90:
public :: register_unlimited_compressed_axis
subroutine register_unlimited_compressed_axis(fileobj, dimension_name, dimension_length)
class(FmsNetcdfFile_t), intent(inout) :: fileobj !< File object.
character(len=*), intent(in) :: dimension_name !< Dimension name.
integer, intent(in) :: dimension_length !< Dimension length for the current rank
integer, dimension(:), allocatable :: npes_start !< The starting index of the dimension for each of the PEs
integer, dimension(:), allocatable :: npes_count !< The size of the dimension for each of the PEs
integer :: i !< For do loops
integer :: err !< Netcdf error
integer :: dimid !< Netcdf id for the dimension
!Gather all local dimension lengths on the I/O root pe.
allocate(npes_start(size(fileobj%pelist)))
allocate(npes_count(size(fileobj%pelist)))
call mpp_gather((/dimension_length/),npes_count,pelist=fileobj%pelist)
npes_start(1) = 1
do i = 1, size(fileobj%pelist)-1
npes_start(i+1) = npes_start(i) + npes_count(i)
enddo
call append_compressed_dimension(fileobj, dimension_name, npes_start, &
npes_count)
if (fileobj%is_root .and. .not. fileobj%is_readonly) then
call set_netcdf_mode(fileobj%ncid, define_mode)
err = nf90_def_dim(fileobj%ncid, trim(dimension_name), unlimited, dimid)
call check_netcdf_code(err, "Netcdf_add_dimension: file:"//trim(fileobj%path)//" dimension name:"// &
& trim(dimension_name))
endif
end subroutine register_unlimited_compressed_axis
After making this changes, recompile FMS, with FMS linked to FMS2 instead of FMS1.
This way, it will allow you to compile for the ocean_SIS2 with FMS2.