Cannot run model for more than 70 years/compiling model with 64 bit integers

Hello, I’m trying to do a long model spin-up with NEMO 4.2. This is for GYRE_PISCES, although that doesn’t really matter. I set nn_itend=12960000 to do a 3000 year long spin-up and got this error:

===>>> : E R R O R


The number of seconds between each restart exceeds the integer 4 max value: 2^31-1.
You must do a restart at higher frequency (or remove this stop and recompile the code in I8)

That led me to reduce nn_stock but I kept getting the same error (even when nn_stock=0). Looking at daymod.F90 the offending line of code is:
IF( REAL( nitend - nit000 + 1 ) * rn_Dt > REAL( HUGE( nsec1jan000 ) ) ) THEN

What that means is I basically can’t integrate the model for more than ~68 years (2^31/86400/365) in a single run. I don’t understand why there should be such a restriction but in any case I tried compiling the model with the -fdefault-integer-8 gfortran flag. This throws a whole bunch of compilation errors like:

2066 | CALL mpi_abort( MPI_COMM_WORLD, 123, info )
| 1
Error: There is no specific subroutine for the generic ‘mpi_abort’ at (1)

This leads me to think I need to rebuild my MPI with the same flag and potentially also hdf5, netcdf-fortran, etc. Which is an awful lot of trouble.

Can someone please tell me how to get around this restriction of run length?

Thanks very much!