I got the errors from gfortran:
write(*,'ERROR in subroutine rddist ')
1
Error: Missing leading left parenthesis in format string at (1)
io-cfs.f:6574.41:
> (nint(MOD(cld_scale*1000000.0, 1000000)) .NE. 0)) THEN
1
Error: ‘a’ and ‘p’ arguments of ‘mod’ intrinsic at (1) must have the same type
Can you let me know what it means and the solutions? Thanks a lot.
Michael
First:
write(*,'ERROR in subroutine rddist ')is not an instruction to write the string'ERROR in subroutine rddist '. The second argument to the write routine is a format string which ought to begin'(and end)'. Since your format string doesn’t begin properly the compiler found an error there. What you probably meant to write was:Now check the Fortran documentation for ‘edit descriptors’ to learn about the second argument to the
writecommand.Second: The
modinstrinsic function requires that both its arguments have the same type (and kind too). You have given it a real numbercld_scale*1000000.0and an integer1000000. Cast one of them to the other’s type according to the type you want the result to be. For type casting check out the functionsrealandint.