Error: Cannot convert CHARACTER to REAL

[edited by the author after this post has been splitted from this one and moved here]

Dear fluka experts,

I’ve followed the instructions found in this link, sugested by @horvathd, that should allow writing in an ASCII file the desired quantities, but I encounter errors when compiling the accordingly modified mgdraw.f file:

image

I guess the first and last one are due to having to write LFCOPE instead of LFCOPF. I tried declaring REGNAM as character to fix the second and third errors, but just encountered more compilation errors. How to fix the above errors? The project files are attached below. Thank you in advance for your help.

Cheers,
Enrico

mgdraw_test.f (15.5 KB)
test userdump.inp (1.2 KB)
test userdump.flair (1.9 KB)

Hi Enrico,

the problem is than neither REGNAM nor LFCOPF are initialized.

Use LFCOPE or initialize LFCOPF the same way as LFCOPE

      LOGICAL LFCOPE
      SAVE LFCOPE
      DATA LFCOPE / .FALSE. /

REGNAM can be just added to line 38

      CHARACTER*20 FILNAM, REGNAM

(note that a single character is not enough, you need a “string” of characters)

with this I can compile your mgdraw file.

2 Likes

Hi Roman,

It now compiles correctly. I forgot a comma in the character declaration. My Fortran practice is a bit rusted. Thank you very much!

Cheers,
Enrico