Fortran runtime error: Assignment of scalar to unallocated array

Discussion on computers, ROMS installation and compiling

Moderators: arango, robertson

Post Reply
Message
Author
remit
Posts: 15
Joined: Mon Jun 21, 2021 12:40 pm
Location: bmkg

Fortran runtime error: Assignment of scalar to unallocated array

#1 Unread post by remit »

Hello ROMS community,
I'm success compiling with command: ./build_roms.sh -j 4

But.. when i.m trying to building executable by typing: ./romsG < roms_upwelling.in
I.m get this error:

Code: Select all

--------------------------------------------------------------------------------
 Model Input Parameters:  ROMS/TOMS version 4.1
                          Sunday - March 27, 2022 -  9:25:52 PM
--------------------------------------------------------------------------------
At line 2595 of file mod_scalars.f90
Fortran runtime error: Assignment of scalar to unallocated array

Error termination. Backtrace:
#0  0x7f8200490d21 in ???
#1  0x7f8200491869 in ???
#2  0x7f8200491ee6 in ???
#3  0x7f82077512bb in __mod_scalars_MOD_initialize_scalars
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/mod_scalars.f90:2595
#4  0x7f82071c0fac in read_phypar_
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/read_phypar.f90:237
#5  0x7f8206776155 in __inp_par_mod_MOD_inp_par
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/inp_par.f90:85
#6  0x7f82050957a5 in __roms_kernel_mod_MOD_roms_initialize
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/roms_kernel.f90:86
#7  0x7f820509725f in myroms
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/master.f90:75
#8  0x7f8205097a8d in main
        at /mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/master.f90:50
Can anyone solve this problem?, in buid_roms.sh, i'm use this setting:

Code: Select all

export         which_MPI=openmpi       # compile with OpenMPI library
export              FORT=gfortran
export         USE_DEBUG=on            # use Fortran debugging flags
export       USE_NETCDF4=on            # compile with NetCDF-4 library
Or, if i'm uncomment USE_DEBUG, I get still error (and yes for this situation i change the command with ./romsS < roms_upwelling.in):

Code: Select all

--------------------------------------------------------------------------------
 Model Input Parameters:  ROMS/TOMS version 4.1
                          Sunday - March 27, 2022 -  9:49:21 PM
--------------------------------------------------------------------------------

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0  0x7f6504fc0d21 in ???
#1  0x7f6504fbfef5 in ???
#2  0x7f6504c4620f in ???
#3  0x7f6504d8ebdd in ???
#4  0x7f65055346f7 in ???
#5  0x7f65054edf47 in ???
#6  0x7f650544861c in ???
#7  0x7f6505358001 in ???
#8  0x7f6505357810 in ???
#9  0x7f6504c270b2 in ???
#10  0x7f65053579bd in ???
#11  0xffffffffffffffff in ???
Segmentation fault (core dumped)
Thank you for your help :)

jcwarner
Posts: 1172
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Fortran runtime error: Assignment of scalar to unallocated array

#2 Unread post by jcwarner »

maybe you could help a bit and track that message, what is on

/mnt/c/Users/lyras/OneDrive/install_roms/folder_tes/Build_romsG/mod_scalars.f90:2595

remit
Posts: 15
Joined: Mon Jun 21, 2021 12:40 pm
Location: bmkg

Re: Fortran runtime error: Assignment of scalar to unallocated array

#3 Unread post by remit »

Hello, jcwarner, this is the hint of the error:

mod_scalars.f90:2595
Image

read_phypar.f90:237
Image

inp_par.f90:85
Image

roms_kernel.f90:86
Image

master.f90:50-75
Image

jcwarner
Posts: 1172
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Fortran runtime error: Assignment of scalar to unallocated array

#4 Unread post by jcwarner »

viewtopic.php?p=23617#p23617

not sure if this was fixed yet or not.
-j

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Fortran runtime error: Assignment of scalar to unallocated array

#5 Unread post by arango »

I know what is the problem. I will load a fix tomorrow. I am taking the day off to take my dogs to the lake.

jcwarner
Posts: 1172
Joined: Wed Dec 31, 2003 6:16 pm
Location: USGS, USA

Re: Fortran runtime error: Assignment of scalar to unallocated array

#6 Unread post by jcwarner »

Sunny up here but looks like rain coming your way Hernan. Enjoy the day! -j

remit
Posts: 15
Joined: Mon Jun 21, 2021 12:40 pm
Location: bmkg

Re: Fortran runtime error: Assignment of scalar to unallocated array

#7 Unread post by remit »

arango wrote: Sun Mar 27, 2022 5:59 pm I know what is the problem. I will load a fix tomorrow. I am taking the day off to take my dogs to the lake.
hai arango, could you please help me solve this problem? :(

User avatar
arango
Site Admin
Posts: 1347
Joined: Wed Feb 26, 2003 4:41 pm
Location: DMCS, Rutgers University
Contact:

Re: Fortran runtime error: Assignment of scalar to unallocated array

#8 Unread post by arango »

Did you update the code?

Post Reply