Type mismatch in argument 'file_id' at (1); passed INTEGER(4) to INTEGER(8)

I am compiling the Fortran code in HPC server. I have loaded the following modules : PrgEnv-gnu/6.0.4, cray-mpich/7.6.0, cray-fftw/3.3.6.3, gcc/7.2.0, cray-hdf5/1.10.0.3 before compiling the code.
After running the “make” command I get the following error:
hdf.f:5012:72:

   call hdf_rFileAttr_f64(file_id,vname,variableold,ierror)
                                                                    1

Error: Type mismatch in argument ‘file_id’ at (1); passed INTEGER(4) to INTEGER(8)
hdf.f:4977:72:

   call hdf_rFileAttr_f32(file_id,vname,variableold,ierror)
                                                                    1

Error: Type mismatch in argument ‘file_id’ at (1); passed INTEGER(4) to INTEGER(8)
hdf.f:4942:72:

   call hdf_rFileAttr_i32(file_id,vname,variableold,ierror)
                                                                    1

Error: Type mismatch in argument ‘file_id’ at (1); passed INTEGER(4) to INTEGER(8)
hdf.f:4091:72:

   call h5eset_auto_f(0, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:4095:72:

   call h5eset_auto_f(1, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:4101:72:

     call h5eset_auto_f(0, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:4103:72:

     call h5eset_auto_f(1, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:3913:72:

   call h5eset_auto_f(0, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:3915:72:

   call h5gopen_f(file_id,grname,gr_id,hstatus)
                                                                    1

Error: Type mismatch in argument ‘loc_id’ at (1); passed INTEGER(4) to INTEGER(8)
hdf.f:3917:72:

   call h5eset_auto_f(1, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:3920:72:

     call h5gcreate_f(file_id,grname,gr_id,hstatus)
                                                                    1

Error: Type mismatch in argument ‘loc_id’ at (1); passed INTEGER(4) to INTEGER(8)
hdf.f:3923:72:

     call h5eset_auto_f(0, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:3925:72:

     call h5eset_auto_f(1, ierr)
                                                                    1

Error: Type mismatch in argument ‘hdferr’ at (1); passed INTEGER(8) to INTEGER(4)
hdf.f:3197:72:

  .                H5S_ALL_F,space_id)
                                                                    1

Error: There is no specific subroutine for the generic ‘h5dwrite_f’ at (1)
hdf.f:1362:72:

   call h5dwrite_f(sds_id,type_id,variable,dim_sizes,ierr,hstatus)
                                                                    1

Error: There is no specific subroutine for the generic ‘h5dwrite_f’ at (1)
Makefile:152: recipe for target ‘hdf.o’ failed
make: *** [hdf.o] Error 1


Why am I getting this error? Please let me know if any more information is required

You have some kind of argument mismatch in the call to hfdwrite_f. This kind of error is discussed in more detail in the recent forum topic Errors compiling code with h5dread_f.

Please note the suggestion to use the F2003 interface, which handles type variations more easily.