Ignore:
Timestamp:
Nov 14, 2020, 3:27:44 PM (4 years ago)
Author:
emillour
Message:

Mars GCM:

  • Make a single README file (get rid of REAME.exec) and update "compile" script to (hopefully) better illustrate how to compile utilities
  • Update utilities zrecast and lslin: zrecast.F90: Force the vertical interpolation of any variable starting by "rho" to be in log space (as it should for density, molecular concentration in mol.cm-3 etc..). Set missing value to 1.E20 lslin.F90: fix various problems in the output.

FF + EM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/util/compile

    r2395 r2432  
    33# > compile concat
    44# > compile zrecast
     5## BUT first you must customize this script to your personal settings:
     6# 1) set up the correct environment; e.g. environment variable
     7#    NETCDF_HOME should point to your NetCDF distribution root directory
     8#    (and possibly you might need to "module load ..." a few things)
     9# 2) put the appropriate compiler and compiler options
     10#    in variables COMPILER and COMPILER_OPTIONS
     11# 3) Note that when you will run the executable, you might need to
     12#    also add the paths to the used libraries (e.g. $NETCDF_HOME/lib)
     13#    in environment variable LD_LIBRARY_PATH (most often the "module load ..."
     14#    command does this, so you should run it before running the executable)
    515
    6 # pgf90 -Bstatic   $1.F90 \
    7 #-I/distrib/local/netcdf/pgi_7.1-6_32/include \
    8 #-L/distrib/local/netcdf/pgi_7.1-6_32/lib -lnetcdf  -o $1.e
     16# Setup: (see at the end of this script for real world examples)
     17# possibly source some modules here and adapt variables below:
     18NETCDF_HOME="/path/to/the/NetCDF/root/directory"
     19COMPILER="gfortran"
     20COMPILER_OPTIONS="-O2"
    921
    10 #ifort $1.F90 \
    11 #pgf90 $1.F90 \
    12 ifort $1.F90 \
    13 -I$NETCDF/include \
    14 -L$NETCDF/lib -lnetcdf -o $1.e
     22# Compilation:
     23# (on some very old systems the Fortran NetCDF library is included
     24#  in the C library and "-lnetcdff" should be replaced with "-lnetcdf")
    1525
    16 # Before running that on you computer you might want to change :
    17 # 1) replace "pgf90" with the name of your favorite compiler
    18 #    (you may also add some non-agressive optimization options e.g. -O2)
    19 # 2) replace "/distrib/local/netcdf/pgi_7.1-6_32/lib" with the
    20 # address of the
    21 # directory that contains the NetCDF library (file libnetcdf.a that can
    22 # be obtained for free on
    23 # http://www.unidata.ucar.edu/packages/netcdf/index.html
    24 # (see user manual)
     26$COMPILER $COMPILER_OPTIONS $1.F90 \
     27-I$NETCDF_HOME/include \
     28-L$NETCDF_HOME/lib -lnetcdff \
     29-o $1.e
     30
    2531#
    26 # 3) Replace "/distrib/local/netcdf/pgi_7.1-6_32/lib" with the address of the
    27 # directory that contains the NetCDF  include file "netcdf.inc"
    28 # that can be obtained at the web address above.
    29 #
    30 # 4) The "-Bstatic" option is here to ensure that the executable will
    31 # work on any Linux machine (only necessary if you want to export the
    32 # executable from a machine to another).
     32# Example of a setup on a simple Linux system where the netcdf library
     33# is in a personal location /home/myacount/netcdf directory:
     34# NETCDF_HOME=/home/myaccount/netcdf
     35# COMPILER="gfortran"
     36# COMPILER_OPTIONS="-O2"
     37# And of course the LD_LIBRARY_PATH environement variable should contain
     38# path "/home/myaccount/netcdf/lib" to be able to run the executable
     39#
     40# Example of a setup on LMD CentOS7 machines using gfortran and NetCDF 4.5:
     41# module purge
     42# module load gnu/7.2.0
     43# module load netcdf4/4.5.0-gfortran72
     44# NETCDF_HOME=/opt/netcdf45/gfortran72
     45# COMPILER="gfortran"
     46# COMPILER_OPTIONS="-O2"
     47# And of course modules above need be loaded before running the executable
     48#
     49# Example of a setup on the Ciclad cluster using ifort and NetCDF 4.3
     50# module purge
     51# module load intel/15.0.6.233
     52# module load netcdf4/4.3.3.1-ifort
     53# NETCDF_HOME=/opt/netcdf43/ifort
     54# COMPILER="ifort"
     55# COMPILER_OPTIONS="-O2 -ip"
     56# And of course modules above need be loaded before running the executable
    3357
    3458
    35 
    36 
Note: See TracChangeset for help on using the changeset viewer.