--------------------------------------- | PALADIN Version 1.02 2002/10/06 | |-------------------------------------| | DOC Version 1.02 2002/10/06 | --------------------------------------- | by Jean-Daniel GRIL CNRM/GMAP/COOPE | | E-mail : Jean-Daniel.GRIL++at++Meteo.fr | | Tel : +33 (0) 561 078 416 | --------------------------------------- PALADIN is for : Portable Auxillary Library And Developpment tools for aladIN The use of this package is to create a portable: -xrd library (minimal package of routine to use only the LFI,FA,FFT parts) -jdglib library (my library to use my programs) -eggx library (with the old eggx and the new eggx) -biper library (some routines of biperidisation : not fully tested) -pack of my programs (PSEUDO,FRODO,EDF,ECTO) To do these you need gmake (gnu make), perl and ksh (or bash) The package use the e-make utility of Eric Sevault modified by me. -------- 1- Directories tree ------------------- PALADIN __ |__ DOC : info on package | |__ tree.dir : tree of the package (directories) | |__ tree.all : tree of the package (all files) | |__ tree.all.size : tree of the package (all files and size) | |__ README : this file | |__ TESTFILES : somes namelists and GEOIN (stations data) | |__ RESULTS : results with file named file. This file is not in the pack, but it's on andante | |__ECTO : (if you have an access) on /u/mrpe/mrpe604, because its size is to big for the | |__EDF : mailer. | |__FRODO | |__PSEUDO | some namelists and a "stations file" for PSEUDO |__ e-make.0.3 : Tool of E.Sevault (modified) | |__ arch : directory of arch makefile named Makefile.in.XXXXX. See below (4.a) | |__ make : directory of original Makefile | |__ perl : directory of perl programs | |__ Makefile : First level of Makefile (copy of ./e-make.0.3/make/Makefile) |__ Makefile.in : Configuration file for Makefile (filling by user). See below (4.b) |__ Makefile.loc : See below (4.c) |__ Makefile.root : See below (4.d) |__ hpscriptFf : script to convert *.F90 in *.f90 with use of HP compiler (before "gmake -r" command) |__ hpscriptfF : script to convert *.f90 in *.F90 with use of HP compiler (after "gmake -r" command) |__ src : all sub directories contains a copy of Makefile file, | a Makefile.loc and Makefile.root file | |__ divers : place for non necessay libraries (contains only biper) | |__ biper : biperiodization routines |__ dummy : contains only subroutine LOCKON in dummy.F90 file |__ eggx : contains the two version of eggx | |__ new_eggx : new eggx | |__ old_eggx : old eggx |__ jdglib : my library subroutines | |__ include : contains an include file with defintions for my library and programs | | the use of CLASSIC defined key permits the use without the xrd real,integer | | fortran kind definitions. Don't use this key to compile this package. | |__ module : my modules |__ jdgprg : sources of my programs | |__ frodo | |__ ecto | |__ edf | |__ pseudo | |__ domolalo <------NEW NEW |__ xrd : xrd library sources (limited pack for the use of LFI,FA,FFT routines) |__ fa : fa routines (facadi.F is the version used with new eggx in model) | |__ include : include fa |__ grib_mf : grib routines part |__ include : include xrd |__ lfi : lfi routines | |__ include : include lfi |__ module : modules (kind definitions) |__ support : fft, dummy, .... routines 2- Tested Compilers ___________________ OS Version Mainframe Compiler Linux 2.4.18 # alpha egcs-2.91.66 (Compacq Fortran compiler) Linux 2.4.17 #1 i686 Lahey/Fujitsu Fortran 95 Express Release L6.00a S/N: LX072865 Linux 2.4.3-20mdk #1 i686 pgf90 3.2-4 Copyright 1989-2001, The Portland Group, Inc. Linux 2.4.18-6mdk #1 i686 pgf90 4.0-2 Copyright 1989-2000, The Portland Group, Inc. Copyright 2000-2002, STMicroelectronics, Inc. HP-UX B.11.00 A 9000/782 HP F90 v2.4 HP-UX B.11.00 U 9000/800 HP F90 v2.5.3 SunOS 5.6 SUNW,Ultra-4 Fujitsu Fortran Compiler Driver Version 4.0.2.1 SunOS 5.6 SUNW,Ultra-4 Sun WorkShop 6 2000/04/07 FORTRAN 95 6.0 IRIX64 irix 6.5.10 IP30 mips MIPSpro Compilers : Version 7.30 3- Defined Keys _______________ OS Compiler comand line e-make.0.3/arch Key locations where used Makefile.in.XXXXX name SunOS Sun gmake -r Makefile.in.SUN4S -DSUN ./e-make.0.3/arch/Makefile.in.SUN4S ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/xbyte.c (file not used) ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/lfi/include/lficom0.h -DSUN4S ./e-make.0.3/arch/Makefile.in.SUN4S ./src/jdglib/include/mykind.h SunOS Fujitsu gmake -r Makefile.in.SUN4F -DSUN ./e-make.0.3/arch/Makefile.in.SUN4F ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/xbyte.c (file not used) ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/lfi/include/lficom0.h -DSUN4F ./e-make.0.3/arch/Makefile.in.SUN4F HP-UX HP gmake -r Makefile.in.HP11H -DHPPA ./e-make.0.3/arch/Makefile.in.HP11H ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/xbyte.c (file not used) ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/lfi/include/lficom0.h -DHP11H remember to use hpscriptFf before ./e-make.0.3/arch/Makefile.in.HP11H -DHPF90I253 ./jdglib/include/mykind.h (for compiler version before 2.5.3) Linux PGI gmake -r Makefile.in.LX86P -DLX86P ./e-make.0.3/arch/Makefile.in.LX86P ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/grib_mf/Makefile.loc ./src/xrd/lfi/include/lficom0.h Linux Lahey/Fuji gmake -r Makefile.in.LX86L -DLX86P ./e-make.0.3/arch/Makefile.in.LX86L (tested and implemented by Neva Pristov) ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/grib_mf/Makefile.loc (key not necessary here) ./src/xrd/lfi/include/lficom0.h Linux Compacq gmake -r Makefile.in.LalphaC -DDEC ./e-make.0.3/arch/Makefile.in.LalphaC (tested and implemented by Neva Pristov) ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/lfi/include/lficom0.h ./src/xrd/support/ishell.F (routine not use in xrd) IRIX64 MIPSpro gmake -r Makefile.in.IRIX64M -DSGI ./e-make.0.3/arch/Makefile.in.IRIX64M ./src/xrd/fa/include/facomp.h ./src/xrd/grib_mf/gsbyte_mf.F ./src/xrd/grib_mf/mxmn_mf.F ./src/xrd/lfi/include/lficom0.h -UCRAY It s a Cray compiler (must not used the default compiler pre-defined key) Nota Bene: the -DLX86P key for "Linux Lahey/Fuji" is necessary for all files excepted ./src/xrd/grib_mf/Makefile.loc. In fact this key gives the "Linux type" to the compiler but it's not necessary for PGI bug because it's not PGI compiler. But it's not a problem because the pgi modified files force the optional argument SIZE only. I'll do better in next version. ---> Remember that on Lahey/Fujitsu compiler you must use: export FORT90L="-Wl, -T" before execution. It's the way to do Little Endian conversion. 4- Description of files needed and used by "gmake" _________________________________________________ a) create a ./e-make.0.3/arch/Makefile.in.OSMFC or use or modify one of existing with OSMFC is OS = OS MF = MainFrame (except for SUN) C = Compiler (in fact gmake -r look at about ./e-make.0.3/arch/Makefile.in.OSMFC file) In tested configurations we don't use *.c source files, so CC and CFLAGS are empty. IS_LIT_E = N (default if not present). Use IS_LIT_E = Y if you have a Mainframe with Little Endian (as PC). FMODINC is the compiler option to specify where are the include module files FMODEXT is the extension of module files FMODWRT is the compiler option to specify where are stored the module files FMODUP is to make module name uppercase (yes) : XXXXXXX.$(FMODEXT) otherwise (no) (default) : xxxxxxx.$(FMODEXT) SHARED = Y is to have shared libraries (*.so or *.sl extensions) STATLIB = Y is to have static libraries (*.a extensions) (if both are "N" then only *.o files will be done) AR = ar : program doing archive static libraries (*.a) ARFLAGS = rv : its options LD = ld : linker used to make shared libraries (depends mainframe) LDFLAGS = -shared -o : its options (depends ld version used) SHRSUFX = so : extension of shared libraies (depends mainframe) PRGSTATFG = -Wl,-Bstatic : for program compilation, options passed to linker to use static libraries at link PRGDYNAFG = -Wl,-Bdynamic : for program compilation, options passed to linker to use shared libraries at link b) go on PALADIN directory and open Makefile.in that contains variables you can modify : SHELL = /bin/ksh : path of your shell (may be bash, better is ksh or sh) ARCH = OSMFC : description of the letters above ifeq ($(MAKELEVEL), 0) : don't touch MAKE = /usr/bin/gmake : use only gmake (gnu), give the path. MAKEFLAGS = r : you must use at least r option MKTOP = $(CURDIR) : don't touch MKLOG = $(CURDIR)/Makefile.log : don't touch LOGFILE = logfile : don't touch MKROOT = $(MKTOP)/e-make.$(VERSION) : don't touch MKOUT = $(MKTOP)/$(ARCH) : directory where the outputs will be locate (use a temprary directory, not your $HOME or /usr/local : see gmake -r clean-out command below) MKMOD = $(MKOUT)/mod : at your own risk MKINC = $(MKOUT)/include : at your own risk MKLIB = $(MKOUT)/lib : at your own risk MKBIN = $(MKOUT)/bin : at your own risk MKBRPATH = $(shell find . -type f -print | egrep -i -e ".(f90|h)$$" | perl -w $(MKROOT)/perl/depdir.pl) : don't touch endif : don't touch c) Makefile.loc description: In ./ directory and subdirectories, the Makefile.loc files contains : SUBDIRS where the "gmake" must go ./Makefile.loc : SUBDIRS = src ./src/xrd/Makefile.loc : SUBDIRS = include module support lfi fa grib_mf ./src/jdglib/Makefile.loc : SUBDIRS = include module ./src/divers/Makefile.loc : SUBDIRS = biper ./src/eggx/Makefile.loc : SUBDIRS = old_eggx new_eggx ./src/Makefile.loc : SUBDIRS = dummy xrd eggx divers jdglib jdgprg In ./src/ subdirectories, the Makefile.loc files contains : SRC_NOTUSED (deselects some sources file) ./xrd/grib_mf/Makefile.loc : use of *.pgi.F version for Portland Group, Inc compiler (Endian pb and ISHFTC intrinsic routine bug - optional argument SIZE needed) SRC_NOTUSED := gsbite_mf.c gsbite_mf.F xbyte.c ifeq "$(IS_LIT_E)" "Y" SRC_NOTUSED := $(SRC_NOTUSED) packgb.F unpagb.F else SRC_NOTUSED := $(SRC_NOTUSED) packgb.le.F unpagb.le.F endif ifeq "$(ARCH)" "LX86P" SRC_NOTUSED := $(SRC_NOTUSED) sbyte_mf.F sbytes_mf.F else SRC_NOTUSED := $(SRC_NOTUSED) sbyte_mf.pgi.F sbytes_mf.pgi.F endif ./xrd/support/Makefile.loc : use of *.vpp.F version for VPP ifeq "$(ARCH)" "VPP5000" SRC_NOTUSED := set99.F fft991.F qpassm.F rpassm.F else SRC_NOTUSED := set99.vpp.F fft991.vpp.F qpassm.vpp.F rpassm.vpp.F endif In ./src/ subdirectories, the Makefile.loc files contains : definitions of libraries local name (extension '.a' is added by "gmake") with LIB variable ./src/divers/biper/Makefile.loc LIB = $(CURDIR)/libbiper_$(ARCH) ./src/dummy/Makefile.loc LIB = $(CURDIR)/libdummy_$(ARCH) ./src/eggx/new_eggx/Makefile.loc LIB = $(CURDIR)/libneweggx_$(ARCH) ./src/eggx/old_eggx/Makefile.loc LIB = $(CURDIR)/liboldeggx_$(ARCH) ./src/jdglib/Makefile.loc LIB = $(CURDIR)/libjdg_$(ARCH) ./src/xrd/Makefile.loc LIB = $(CURDIR)/libxrd_$(ARCH) In ./src/jdgprg/ subdirectories, the Makefile.loc files contains : definitions of executables making with use of variables EXE (name of executable), SRCP (source program name), LIBS (libraries needed by linker) (the name of libraries are as libXXX_$(ARCH).a, for the linker only the XXX_$(ARCH) part of name is usefull, and for LIBS variable only the XXX is usefull because "gmake" adds '_$(ARCH)'). These variables are only used in program compilation part, see below) ./src/jdgprg/edf/Makefile.loc EXE = edf SRCP = editfield.o LIBS = jdg xrd dummy neweggx oldeggx ./src/jdgprg/ecto/Makefile.loc EXE = ecto SRCP = ectoplasme.o LIBS = jdg xrd dummy neweggx oldeggx ./src/jdgprg/frodo/Makefile.loc EXE = frodo SRPC = frodo.o LIBS = jdg xrd dummy neweggx oldeggx ./src/jdgprg/pseudo/Makefile.loc EXE = pseudo SRCP = pseudo.o LIBS = jdg xrd dummy neweggx oldeggx ./src/jdgprg/domolalo/Makefile.loc EXE = domolalo SRCP = domolalo.o LIBS = jdg xrd dummy neweggx oldeggx d) Makefile.root description: All Makefile.root files contain paths for dependencies search : VPATH = $(MKBRPATH) : don't touch this line (MKBRPATH variable is created by line in Makefile.in, see above) 5- How to use "gmake" ____________________ List of usefull commands used on PALADIN/ directory : -- copy of Makefile program in all subdir (if I send you a new version) : (The original code of Makefile is on ./e-make.0.3/make) gmake -r make -- copy of Makefile.root from PALADIN/ directory to subdirectories (generaly not used) : gmake -r root -- compile libraries (after updating ./Makefile.in and ./e-make.0.3/arch/Makefile.in.OSMFC, see 4.a and 4.b) : gmake -r compile The CompileLogFileName contains the log of compilations -- install usefull files in ./$(MKOUT)/lib,./$(MKOUT)/mod,./$(MKOUT)/include, directories : gmake -r install -- make program files in ./$(MKOUT)/bin : gmake -r program -- make dependencies files (local or recursive) : (the use of some "gmake -r" commands do implicitly a gmake -r depend) gmake -r depend gmake -r depend-r -- info on variables : gmake -r info gmake -r info-r : recursive info along subdirectories -- clean commands : gmake -r clobber : rm *.o *.ok *.$(FMODEXT) gmake -r clobber-r : recursive clobber along subdirectories gmake -r clean : rm *.o *.ok *.$(FMODEXT) $(LIB) (if local libraries are selected : SHARED = Y or STATLIB = Y) gmake -r clean-r : recursive clean along subdirectories gmake -r clean-output : clean $(MKOUT) directory (take care at the value of $(MKOUT)) gmake -r clean-depend : clean *.dep file (dependencies) gmake -r clean-depend-r : recursive clean-depend along subdirectories gmake -r clean-all : equivalent to clean-r clean-depend-r clean-output -- HP compiler doesn't compile *.F90 sources files, so you must used : hpscriptFf : convert all *.F90 files in *.f90 before a use any "gmake -r" commands hpscriptfF : convert all *.f90 files in *.F90 (to retrieve the original package) -- All : gmake -r : compile libraries, install and do programs gmake -r all : the same 5- How to compile Libraies and Programs _______________________________________ After ungziped and untared this package : - go under PALADIN directory - modify the Makefile.in with your shell and ARCH value - modify or create the ./e-make.0.3/arch/Makefile.in.$(ARCH) file - do : export MKPACK=/(absolute-path-to)/PALADIN a) Classic use : - (if you use hp compiler do : ./hpscriptFf) : use your shell command to launch it, ie : (/bin/sh ./hpscriptFf) - WARNING : On some mainframes if you have problem ("entering in an unknown directory") then try to do : gmake -r depend-r - gmake -r 1>CompileLogFileName 2>&1 : make the three next "gmake -r" commands you have log file of compilation in CompileLogFileName file - WARNING : if you use shared libraries then don't forget to add LD_LIBRARY_PATH in your .profile (or others) pointing your shared libraries directory. b) Equivalent use : - gmake -r compile 1>CompileLogFileName 2>&1 : compile all fortran libraries files and create local libraries (if you specify it) you have log file of compilation in CompileLogFileName file - gmake -r install : create $(MKOUT) subdirectories (lib, include, mod, bin) and fill the 3 first one) - gmake -r program : make executables in $(MKOUT)/bin You can test them with file, namelists in ./TESTFILES --> Nota Bene : - (if you use hp compiler do : ./hpscriptfF) : if you want to replace *.F90, take care. do it only if you want to recreate the original package after cleaning all. use your shell command to launch it ie : (/bin/sh ./hpscriptfF) 6- Endian problems on Linux/Intel _________________________________ You need to convert little endian / big endian the use of a compiler with a good option. On web I see tested fortran compilers and it seems that 4 have only this possibility : ABsoft, Portland Group Inc, Fujitsu, Compacq 7- Others compilers problems ____________________________ - With this version of PGI compiler the intrinsec subroutine ISHFTC is bugged : the optional argument SIZE must be specified => version of the routines hat call ISHFTC are cloned in *.pgi.F and selected in ./src/xrd/grib_mf/Makefile.loc file. I don't make tests with PGI 4.0-2 (Next time) - With this version of HP compiler the GETARGC function is bugged : it returns for argument 0 a blank line, for 1 the name of the program, for 2... the arguments of the program. To resolve this problem, we use the F77 library (+U77 option) with a defintion of GETARGC (and IARGC) as EXTERNAL. These modifications are used in all my programs and are selected by a macro in my ./src/jdglib/include/mykind.h file (compiler key HPF90I253). Since version 2.5.3 Hp corrects this bug. - With this version of SUN compiler the SCAN intrinsec function is bugged : it returns -xxxx and not 0 with no occurence when .TRUE. argument is present. To correct it, see the macro ./src/jdglib/include/mykind.h file used in (call of SCAN) ./jdglib/module/STRING_LIB_MOD.F90 file. - Neva had some problems : * with ecto namelist format and Compacq compiler : L(:,1)=1,2,.. don't work, she must split as L(1,1)=1, L(2,1)=2, * with pseudo.F90 code with Lahey/Fujitsu compiler : ( > : original file, < : modified file ) < USE DATAS_FA, ONLY : ALIFA --- > USE DATAS_FA, ONLY : ALIFA, FACAD < ii=NINT(PSEUDO_UO(I)%ENTETE%HAUT) < I2STR( ( ii * _ITEN_) + _ICENMIL1_,_IFIVE_) // ' ' --- > I2STR((NINT(PSEUDO_UO(I)%ENTETE%HAUT) * _ITEN_) + _ICENMIL1_,_IFIVE_) // ' ' < i=SIZE(PSEUDO_UI) < ALLOCATE(PSEUDO_UI(i)%DONNEES(_IZERO_:VCAD%NLEV)) --- > ALLOCATE(PSEUDO_UI(SIZE(PSEUDO_UI))%DONNEES(_IZERO_:VCAD%NLEV)) I'll look for these problems next time. I don't change the source now. I remember that I added FACAD in USE statement because one of the tested compiler ( I don't remember what) need it. 8- News, Changes ________________ - For the size of reals and integers : for files in *.F90 the size is selected by JPIM and JPRB (in tmsbkind.h and PARKIND1.F90) for all variables. It's no necessary to add something like -r8 -i4 (the classic values of JPRB JPIM) in F90FLAGS (Makefile.in.OSMFC). for files in *.F you must add this compiler flags in F77FLAGS. - From the last beta version the changes are : In ./src/xrd/grib_mf/Makefile.loc with the IS_LIT_E key for Little Endian In ./src/jdglib/module/EGG_TOOLS_MOD.F90, I add lat-lon case (ERPK < 0.0) in SUBROUTINE OUTEGGX - 2002.09.06 : V1.01 EGG_TOOLS_MOD.F90 : modication for lat-lon domain in old eggx files - 2002.10.06 : V1.02 eggpack.F90 : correction of bug in xy_to_rtheta : if y=0 then theta is not given by "atan(x/y)". EGG_TOOLS_MOD.F90 : lines 78 & 79 too long for some compilers (breaking lines) mykind.h : add a DEBUG define key to make outputs or not (see domolalo.F90 in src/jdgprg/domolalo) domolalo.F90 : a new program. Define an Aladin domain (plus eight points on each sides containing a lat-lon domain). Inputs are : SOUTH NORTH WEST EAST RESOLUTION (the same in X and Y). the Reference point latitude is (NORTH+SOUTH)/2 | excepted in some cases the Reference point longitude is (WEST+EAST)/2 | excepted in some cases West and East may have the same value : in this case the domain is from West to East. For MERCATOR you need to use SOUTH=-NORTH (if NORTH > 70° then a question asks to cut or stop) For STEREOPOLAR : If NORTH = |SOUTH| = 90° then the domain is centered on pole ( Center domain latitude = 90° ) On outputs the SW,NE,SE,NW have the same latitude This case don't work with old wersion of EGGX For LAMBERT : If |(NORTH+SOUTH)/2| > 70° then Reference point Latitude=90° and program make a STEREOPOLAR If |(NORTH+SOUTH)/2| < 20° then program make a MERCATOR (except if NORTH or |SOUTH| > 70°) If pole will appear in lambert output domain then program make a STEREOPOLAR If WEST = EAST then LAMBERT is changed in STEREOPOLAR or MERCATOR and the added points are supress on X. You can give input datas : from command line (five value : SOUTH,NORTH,WEST,EAST,RESOL) from namelist (one cmd line value : name of namelist filethat contains NAMELIST /NAML/SOUTH,NORTH,WEST,EAST,RESOL) from interactive mode (no parameters in cmd line) Outputs are in a namelist file named : namelist_domaine ____________________________________________________________________________________________________________________________________