email us   
Eulag
All-Scales
Geophysical Research Model
 

EULAG COMPILATION AND EXECUTION


The user selected options are written into external script file and the script is executed at the current node assuming the compiler is available over there.


Depending on the specified MACHINE proper compiler options are selected:

    set NETCDF_INCLUDE = '/opt/netcdf/include'
    set NETCDF_LIB = '/opt/netcdf/lib'
    
    cp ${NETCDF_INCLUDE}/netcdf.inc .
    cp ${NETCDF_INCLUDE}/typesizes.mod .
    cp ${NETCDF_INCLUDE}/netcdf.mod .
    
    
    if ($NPE == 1) then
    set PGF90 = '/opt/pgi/bin/pgf90'
    set PGF90 = '/opt/pgi/bin/pgf90 -fpic -tp core2-64'
    if ( $NCARG == 1 ) then  # COMPILE WITH NCAR GRAPHICS
       if ( $WORD == 4 ) then
          echo "${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F"
          ${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F
          echo "${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -lnetcdff -lnetcdf"
          ${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -L${NETCDF_LIB} -lnetcdff -lnetcdf \
          -L/usr/local/ncarg/lib -L/usr/X11R6/lib -L/usr/dt/lib \
          -lncarg -lncarg_gks -lncarg_c -lX11 -lm -lf2c
       else
          echo 'NCAR_GRAPHICS with double prec. not implemented'
          echo 'If you need a double precision version have your '
          echo 'system administrator contact ncargfx@ncar.ucar.edu'
       endif
    else   # COMPILE WITHOUT NCAR GRAPHICS
       if ( $WORD == 4 ) then
          echo "${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F"
          ${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F
          echo "${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -lnetcdff -lnetcdf"
          ${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -L${NETCDF_LIB} -lnetcdff -lnetcdf
       endif
       if ( $WORD == 8 ) then
          echo "CURRENTLY NOT AVAILABLE FOR DOUBLE PRECISION IMPLEMETATION ON LINUXCLUSTERS"
          echo "${PGF90} -c -O2 -r8 -Mcray=pointer -Mnoframe -Kieee src.F"
          ${PGF90} -c -O2 -r8 -Mcray=pointer -Mnoframe -Kieee src.F
          echo "${PGF90} src.o $OBJECTS -O2 -r8 -L/opt/pgi/linux86/lib -lnetcdff -lnetcdf"
          ${PGF90} src.o $OBJECTS -O2 -r8 -L/opt/pgi/linux86/lib -L${NETCDF_LIB} -lnetcdff -lnetcdf
       endif
    endif
    else
    set PGF90 = '/opt/mpich/bin/mpif90'
       if ( $WORD == 4 ) then
          echo "${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F"
          ${PGF90} -c -O2 -Mcray=pointer -Mnoframe -Kieee src.F
          echo "${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -L/opt/mpich/lib-L${NETCDF_LIB} -
    lfmpich -lmpich -lnetcdff -lnetcdf"
          ${PGF90} src.o $OBJECTS -O2 -L/opt/pgi/linux86/lib -L/opt/mpich/lib -L${NETCDF_LIB} -lfmpi
    ch -lmpich -lnetcdff -lnetcdf
       endif
       if ( $WORD == 8 ) then
          echo "CURRENTLY NOT AVAILABLE FOR DOUBLE PRECISION IMPLEMETATION ON LINUXCLUSTERS"
          echo "${PGF90} -c -O2 -r8 -Mcray=pointer -Mnoframe -Kieee src.F"
          ${PGF90} -c -O2 -r8 -Mcray=pointer -Mnoframe -Kieee src.F
          echo "${PGF90} src.o $OBJECTS -O2 -r8 -L/opt/pgi/linux86/lib -L/opt/mpich/lib-L${NETCDF_LI
    B} -lfmpich -lmpich -lnetcdff -lnetcdf"
          ${PGF90} src.o $OBJECTS -O2 -r8 -L/opt/pgi/linux86/lib -L/opt/mpich/lib -L${NETCDF_LIB} -l
    fmpich -lmpich -lnetcdff -lnetcdf
       endif
    endif
    endif
    


There are two basic methods for compile and run EULAG model:

1) The first and more commonly used method requires proper set up of the options described in C-SHELL SCRIPT and execute the shell script with:

    csh script_name.csh

where "script_name.csh" is an arbitrary name, and doesn't need contain "csh" appendix. The other way is to add executable attributes to the script and run it as the binary program:

    chmod a+x script_name.csh
    ./script_name.csh

After executing the script the script activate user defined options, change directory from the current directory location to the working directory $DIR and create all necessary files ready for model compilation. Then the model will be compiled and depending on the $BATCH option either the batch file (either run_paral or run_serial) will be sent to the queue system or the model executable will be run in the interactive mode on local system.


2) After the script will be executed user may have possibility to work in the offline mode with the files created in the job working directory $DIR.

In this case user is responsible for change parameters in created previously included files and block_data files and set proper precompiler directives (defined by #define ...) at the beginning of the EULAG source code src.F.

A few additional options are copied from the main model script into the script used for compilation (e.g. script name .compile_lnx. created for the selected MACHINE LNX). The following options within the compiler script should be verified for compatibility with other options (mainly the precompiler directives in the main source code src.F):

    set NPE = ...

    set NCARG = ...

    set WORD = ...

    set OBJECTS = ...

After setting up all of the required options user may compile the source code with the created compiler script using .csh. command:

    csh compile_lnx

If the executable is created user may run the executable on local system or send the appropriate batch script to the queue. The details for the binary code execution vary depending on local system requirements and EULAG options selected.


JavaScript DHTML Drop Down Menu By Milonic