The IOIPSL Library

From Planets
Revision as of 12:13, 12 June 2024 by Emillour (talk | contribs) (Downloading the IOIPSL library sources)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The IOIPSL (for Input Output IPSL) library is a library used by the GCM to read in input parameters from the run.def text file and related *.def files. It can in fact do more, such as writing output NetCDF files a, a feature not used by the Generic model's physics package.

Just like for any library, one should need to only install it once and then just use it by linking to it and pointing to its modules. In practice via the compilation options:

-L/path/to/the/ioipsl/library/lib -lioipsl
-I/path/to/the/ioipsl/library/inc


Installing the IOIPSL library

There are some dedicated scripts in LMDZ.COMMON/ioipsl that one can adapt and use, hopefully without too much trouble using pointers and information given here

Prerequisites

IOIPSL is written in Fortran, so you need to have a Fortran compiler at hand (gfortran in the following examples), as well as an available NetCDF library compiled using that same compiler.

One of the IOIPSL install scripts uses ksh (Korn Shell), which is not always available (Bash, Bourne Again Shell, is now the standard). So you might want to first install it, e.g. on Linux-Ubuntu:

sudo apt install ksh

If that is not an option (e.g. you do not have super-user privileges to install ksh) the you will need to manually modify a file (see section "Know problems and issues worth knowing about" below)

Downloading the IOIPSL library sources

One can do this using svn (subversion):

svn checkout --username icmc_users --password icmc2022 https://forge.ipsl.fr/igcmg/svn/IOIPSL/trunk IOIPSL

where the trailing argument IOIPSL is customizable to whatever (non existing) subdirectory name one wants to have the library put in.

The makeioipsl_fcm compilation script and related FCM architecture files

The main script to compile the library is makeioipsl_fcm, located in the distribution's top directory. It uses FCM (Flexible Configuration Management) to know about specific configuration options and set-up and thus requires (just like the GCM) appropriate architecture files. These files contain information on which compiler to use, what compilation options to use, where relevant libraries are located etc. In practice one must thus create these ASCII text files in the arch/ subdirectory. The naming convention is rather straightforward, when the script makeioipsl_fcm is run with the option -arch somename, it will look for files arch/arch-somename.env, arch/arch-somename.path and arch/arch-somename.fcm.

TODO: DETAIL ARCH FILE CONTENTS (Or give link to dedicated page?)

Note that one can (and should! At least that is what we recommend) use the same set of architecture files for the GCM and IOIPSL.

Building the IOIPSL library then merely requires running the makeioipsl_fcm with the adequate mandatory -arch option (note that one can lear about all the possible options by running ./makeioipsl_fcm -h), e.g.:

./makeioipsl_fcm -arch gfortran


Checking that the install was successful

If the previous step went well the IOIPSL/lib directory should contain the library:

libioipsl.a

and the IOIPSL/inc directory should contain the following module files:

calendar.mod   flincom.mod   histcom.mod  restcom.mod
defprec.mod    fliocom.mod   ioipsl.mod   stringop.mod
errioipsl.mod  getincom.mod  mathelp.mod

Congratulations! You can now use the IOIPSL library.

Know problems and issues worth knowing about

  • ksh is needed to compile "out of the box"; if ksh is not available then the workaround is to replace line
#!/bin/ksh

to

#!/bin/bash

in the IOIPSL/ins_m_prec file

  • Recent versions of the IOIPSL fails to work properly if compiled by gfortran version 4.8.5 (see e.g. https://trac.lmd.jussieu.fr/Planeto/ticket/62 ) but works fine with more recent versions of the compiler (tested with versions 7.2+)
  • As of April 2022 the IOISPL distribution requires username/password authentication.