Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1) in PyOpt

I am attempting to install pyOpt and have run into an error where the Mingw64 gfortran compiler throws an error. It appears that the variable 'g' is held in a common block in an include file while 'dum' is locally declared. What can be done to overcome these errors?

Warning: 'rhoc' may be used uninitialized in this function [-Wmaybe-uninitialized]
pyOpt\pyALGENCAN\source\evalal.f:408:35:

  408 |               call sevalgjacp(n,xp,gp,m,dpdcp,nalp,'T',gotj,inform)
      |                                   1
......
  802 |           call sevalgjacp(n,x,dum,m,ap,ptmp,'j',gotj,inform)
      |                              2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
pyOpt\pyALGENCAN\source\evalal.f:112:34:

  112 |               call sevalgjacp(n,x,g,m,p,nl,'T',gotj,inform)
      |                                  1
......
  802 |           call sevalgjacp(n,x,dum,m,ap,ptmp,'j',gotj,inform)
      |                              2
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
gfortran.exe:f77: pyOpt\pyALGENCAN\source\fparam.f
pyOpt\pyALGENCAN\source\extrap.f:183:10:
like image 866
user3883001 Avatar asked Jan 20 '26 17:01

user3883001


1 Answers

you may just need to add the following flag to the compilerfile or makefile that sets everything up.

-fallow-argument-mismatch

where my file looks like this.. and my line was called COMOTT1

startfile

###COMPILE=f77
###COMPILE=pgf90 
COMPILE=gfortran


 COMLIB1=

#COMOTT1=-dalign -O3 -r8
###COMOTT1=-dalign -fast -r8
#COMOTT1=-Ofast -mips4 -IPA -r8
# COMOTT1=  -fast -O3 -r8
 COMOTT1=  -Ofast -fdefault-real-8 -fallow-argument-mismatch
### COMOTT1=  -fast  

# COMCONV= -byteswapio 
 COMCONV= -fconvert=swap

FILES= \
       cpl_bcinterp.o \
       cpl_land.o \
       cpl_main_interface.o \
       cpl_sea.o \
       cpl_sea_model.o \
       dyn_geop.o \
       dyn_grtend.o \
       dyn_implic.o \
       dyn_sptend.o \
       dyn_step.o \
       dyn_stloop.o \

endfile

so hopefully that works for you

like image 114
dylan Avatar answered Jan 23 '26 07:01

dylan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!