compile problem in R4DVAR

Facts, news, and guidance about ROMS software

Moderators: arango, robertson

Post Reply
Message
Author
User avatar
susonic
Posts: 171
Joined: Tue Aug 21, 2007 5:44 pm
Location: UST21 / Korea
Contact:

compile problem in R4DVAR

#1 Unread post by susonic »

Hi all,

I have encountered the compiling error when I tried to use the R4DVAR.

I used build.bash and got below result
/opt/mpich2/bin/mpif90 -O3 -tp core2-64 /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/esmf_roms.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/master.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/ocean_control.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/ocean_coupler.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/propagator.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/roms_export.o /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/roms_import.o -o /home/ocean/model/trunk32/project/WC13/R4DVAR/oceanM /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libADM.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libADM_bio.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libRPM.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libRPM_bio.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libTLM.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libTLM_bio.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libNLM.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libNLM_bio.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libNLM_sed.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libANA.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libUTIL.a /home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libMODS.a -L/usr/local/netcdf/lib -lnetcdf -L/opt/ARPACK -lparpack -L/opt/ARPACK -larpack
/home/ocean/model/trunk32/project/WC13/R4DVAR/Build/libUTIL.a(posterior_var.o): In function `posterior_var_mod_posterior_var_tile_':
/home/ocean/model/trunk32/project/WC13/R4DVAR/Build/./posterior_var.f90:304: undefined reference to `dpotrf_'
/home/ocean/model/trunk32/project/WC13/R4DVAR/Build/./posterior_var.f90:314: undefined reference to `dpotri_'
make: *** [/home/ocean/model/trunk32/project/WC13/R4DVAR/oceanM] Error 2
I got the same result when I tried to compile the PSAS.

I compiled I4DVAR successfully and the model was run without any problem.

Any suggestion would be great.

Regards,

-Peter
Joonho Lee

User avatar
susonic
Posts: 171
Joined: Tue Aug 21, 2007 5:44 pm
Location: UST21 / Korea
Contact:

Re: compile problem in R4DVAR

#2 Unread post by susonic »

I'm back to here to report the solution which I was stuck in before.

I was trying to run the example, WC13 from recent assimilation Workshop.

Thanks to the detailed explanation, I was able to run the I4DVAR.

To run the I4DVAR, one need to compile the ARPACK tools before they run the model.

I compiled the ARPACK. I4DVAR ran without any problem.

However, the problem happened when I was about to run the PSAS or R4DVAR.

Those two model demand dpotrf and dpotri funtion which is in LAPACK tools.

LAPACK can be compiled when one compile ARPACK.

And I didn't realize that my LAPACK is very old one which those two function is not included.

I spent some of my time to find newer LAPACK version and tried to install it on my machine.

I failed to compile the new version of LAPACK.

Later on I finally realize that ARPACK tools which has dpotrf and dpotri function are included in ROMS code (trunk/Lib/ARPACK).

I compiled that one again and run PSAS. It began to run smoothly.


During the compiling the ARPACK from ROMS code, I found that header file(mpif.h) is missing

in both PARPACK/SRC/MPI and PARPACK/UTIL/MPI.

So, I think it needs to be included.


Also, I think it would be nice that the ROMS administrator add a description about the location of ARPACK

as a tip of 4DVAR in order not to happen similar situation of mine.



Lastly, I'm grateful for all the detailed guide of 4DVAR example from wikiROMS to workshop agenda.

Thank you

-JH
Joonho Lee

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

Re: compile problem in R4DVAR

#3 Unread post by arango »

You are using the wrong ARPACK/PARPACK library. You need to use and compile the source code provided in the ROMS repository for these libraries. See trunk sub-directory Lib/ARPACK/LAPACK. You will notice that both dport.f and dpotri.f are located in this directory. Users need to use the ARPACK/PARPACK library provided in the ROMS repository because few changes have been made to these libraries to allow checkpointing in the adjoint-based, GST algorithms. Also we included a additional files needed for matrix inversion in the BLAS and LAPACK sub-directories, see :arrow: ticket 333. The original ARPACK library is distributed with only the files that are needed internally.

You are not compiling the parallel PARPACK library correctly. The file mpif.h is not part of the ARPACK/PARPACK library :!: This is done in the makefile since there are various possibilities for the MPI library (MPICH1, MPICH2, OpenMPI, native). The header file mpif.h is architecture dependent. Notice that ROMS does not have this header file either. This is all managed during compilation.

We will add a more visible documentation in :arrow: WikiROMS for the ARPACK/PARPACK libraries.

User avatar
susonic
Posts: 171
Joined: Tue Aug 21, 2007 5:44 pm
Location: UST21 / Korea
Contact:

Re: compile problem in R4DVAR

#4 Unread post by susonic »

Hi, Dr. Arango. Thank you for your reply.

At first, I used original(wrong) ARPACK but later I used a right one which you are describing above (I wrote about that).


You are right about the mpif.h. It does not exist in the original ARPACK library.


Thank you for your note.

-JH
Joonho Lee

bangdt
Posts: 30
Joined: Sun Mar 10, 2019 2:34 pm
Location: University of Tsukuba

Re: compile problem in R4DVAR

#5 Unread post by bangdt »

Dear Sir Arango!

When I tried to copile the ARPACK, because of my system I should choose the file ARmake.mpif90-Linux, but options of the file such as

FC = mpif90
FFLAGS = -u -Bstatic -fastsse -Mipa=fast

# Set the parallel fortran compiler

PFC = mpif90
PFFLAGS = -u -Bstatic -fastsse -Mipa=fast

Did not work. I have these error

Makefile:50: warning: overriding recipe for target '.f.o'
../ARmake.inc:91: warning: ignoring old recipe for target '.f.o'
mpif90 -u -Bstatic -fastsse -Mipa=fast -c sgetv0.f
gfortran: error: unrecognized command line option ‘-fastsse’
gfortran: error: unrecognized command line option ‘-Mipa=fast’
Makefile:50: recipe for target 'sgetv0.o' failed

And I realise these setting are same with ARmake.MPI-Linux file.

could you please let me known the right setting of ARmake.mpif90-Linux file?

when I by pass -fastsse -Mipa, the ARPACK can successfully install and linked, but It take me to other error like in this topic notify that I do not have dport.f and dpotri.f when I tried to run buil_roms.bash

Thank you so much for your hard works.

PS. this is my mpif90 version

root@C2:/work/apps/gnu_4.8.5/ROMS/3.0.1/trunk/Lib/ARPACK# mpif90 --version
GNU Fortran (Ubuntu 7.4.0-1ubuntu1~18.04) 7.4.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.




[/quote]
We will add a more visible documentation in :arrow: WikiROMS for the ARPACK/PARPACK libraries.[/quote]

sashagrm23
Posts: 1
Joined: Wed Jan 26, 2011 6:11 am
Location: CINVESTAV-Merida: LAPCOF

Re: compile problem in R4DVAR

#6 Unread post by sashagrm23 »

Hi bangdt,

I had the same problem that you described in your last post.
Looking for in pages about the gfortran and pgi Fortran compilers, I found these flags are only to pgi compiler:
FC = mpif90
FFLAGS = -u -Bstatic -fastsse -Mipa=fast

PFC = mpif90
PFFLAGS = -u -Bstatic -fastsse -Mipa=fast

I modified the flags to:
FC = mpif90
FFLAGS = -O3

PFC = mpif90
PFFLAGS = -O3

and I got the Arpack libraries.

Regards.

S.

Post Reply