Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

(RESOLVED) Unstable to install obsgrid on ubuntu 22.04

D

Deleted member 3607

Guest
So I am getting the following error

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


Code:
cd $HOME/WRFCHEM/
git clone https://github.com/wrf-model/OBSGRID.git
cd $HOME/WRFCHEM/OBSGRID

./clean -a
source $Miniconda_Install_DIR/etc/profile.d/conda.sh
conda init bash
conda activate ncl_stable


export HOME=`cd;pwd`
export DIR=$HOME/WRFCHEM/Libs
export NETCDF=$DIR/NETCDF

./configure FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch  #Option 2

sed -i 's/-C -P -traditional/-P -traditional/g' configure.oa
sed -i 's/-lnetcdf -lnetcdff/ -lnetcdff -lnetcdf/g' configure.oa
sed -i 's/-lncarg -lncarg_gks -lncarg_c -lX11 -lm -lcairo/-lncarg -lncarg_gks -lncarg_c -lX11 -lm -lcairo -lfontconfig -lpixman-1 -lfreetype -lhdf5 -lhdf5_hl /g' configure.oa


./compile FFLAGS=-fallow-argument-mismatch FCFLAGS=-fallow-argument-mismatch

conda deactivate
conda deactivate

I have found that installing obsgrid using miniconda works best with these changes. The commands work on ubuntu 20.04.4 but not the newest one. I'm certain it has something to do with gcc/gfortran/g++ version 11 which is standard on the new ubuntu.
 
compile log
 

Attachments

  • obsgrid.compile.txt
    23.1 KB · Views: 9
Possible resolution

configure.oa needs to have these lines edited by sed command.

sed -i 's/-C -P -traditional/-P -traditional/g' configure.oa


sed -i 's/-lnetcdf -lnetcdff/ -lnetcdff -lnetcdf/g' configure.oa

sed -i 's/-lncarg -lncarg_gks -lncarg_c -lX11 -lm -lcairo/-lncarg -lncarg_gks -lncarg_c -lX11 -lm -lcairo -lfontconfig -lpixman-1 -lfreetype -lhdf5 -lhdf5_hl /g' configure.oa

sed -i '39s/-ffree-form -O -fconvert=big-endian -frecord-marker=4/-ffree-form -O -fconvert=big-endian -frecord-marker=4 -fallow-argument-mismatch /g' configure.oa

sed -i '44s/= /= -fallow-argument-mismatch /g' configure.oa
 
UPDATE

-fallow-argument-mismatch is a new flag and is not supported by < GGC9. A flag that does the same thing and is supported it -std=legacy
 
Top