lhico / docker4roms

Repository to store files related to docker and docker-compose, in order to run the Regional Ocean Model System.
6 stars 1 forks source link

feature: update docker to enable assimilation procedures #5

Open dksasaki opened 1 year ago

dksasaki commented 1 year ago

Assimilation procedures require the compilation flags -lparpack and -larpack that are absent from the current docker image. According to the ROMS wiki, the compilation requires a modified version of these libraries that can be obtained from the SVN trunk.

I was able to compile the model with the libraries (notice that the correct flags for data assimilation must be activated in the corresponding .h file).

I'll register the procedure here, so we can incorporate the modifications to the docker image eventually.

Within the interactive docker container:

cd rom_src
mkdir Lib
cd Lib
svn checkout https://www.myroms.org/svn/src/libs/ARPACK
cd ARPACK

We need to set the appropriate flags to gfortran. Edit the ARmake.inc lines 147-148 to

#FC = ifort
#FFLAGS = -ip -O3 -fp-model precise

FC  = gfortran
FFLAGS = -O3 

And lines 154-155 to

#PFC     = mpif90
#PFFLAGS = -ip -O3 -fp-model precise

FC  = gfortran
FFLAGS = -O3 

After editing, in the same directory, run:

make all

After compiling, libarpack.aand libparpack.a are ready. We move them to the root directory with

sudo mv libarpack.a /usr/lib/x86_64-linux-gnu/
sudo mv libapack.a /usr/lib/x86_64-linux-gnu/

Afterwards, the compilation should run successfully. This procedure must be adapted to the dockerfile.

dksasaki commented 1 year ago

I pushed a change with the dockerfile and docker-compose (personal case). The model compiles successfully, now we need to test it with the appropriate files.