Está en la página 1de 6

INSTALACION DE SOFTWARS NECESARIOS

sudo apt install gfortan csh m4 buil-essential

PRUEBA DEL ENTORNO DEL SISTEMA


Es importante tener el compilador gefortran, gcc y cpp
Es necesario ver la ruta donde están ubicados:

which gfortran
which cpp
which gcc

Revisar la versión del gcc, se recomienda usar la versión 4.4.0 o superior.

gcc --version

CREAR LAS CARPETAS Build_WRF y TESTS

mkdir Buil_WRF TESTS

PRUEBAS:

mkdir TESTS
cd TESTS

wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fortran_C_tests.tar
tar -xvf Fortran_C_tests.tar
gfortran TEST_1_fortran_only_fixed.f
./a.out
SUCCESS test 1 fortran only fixed format

gfortran TEST_2_fortran_only_free.f90
./a.out
Assume Fortran 2003: has FLUSH, ALLOCATABLE derived type, and ISO C Binding
SUCCESS test 2 fortran only free format

gcc TEST_3_c_only.c
./a.out
SUCCESS test 3 C only

gcc -c -m64 TEST_4_fortran+c_c.c


gfortran -c -m64 TEST_4_fortran+c_f.f90
gfortran -m64 TEST_4_fortran+c_f.o TEST_4_fortran+c_c.o
./a.out
C function called by Fortran
Values are xx = 2.00 and ii = 1
SUCCESS test 4 fortran calling c

./TEST_csh.csh
SUCCESS csh test

./TEST_perl.pl
SUCCESS perl test
./TEST_sh.sh
SUCCESS sh test

cd ..

INSTALACION DE LIBRERIAS:

cd Build_WRF
mkdir LIBRARIES
cd LIBRARIES

wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/mpich-3.0.4.tar.gz
wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/netcdf-4.1.3.tar.gz
wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/jasper-1.900.1.tar.gz
wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/libpng-1.2.50.tar.gz
wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/zlib-1.2.7.tar.gz

Instalación de las librerias:


Para empezar con la configuración de NETCDF, modificar el archivo .bashrc ubicado en la carpeta del
usuario (/home/jgv). Fikar las variables del entorno haciendo uso del export:

# WRF Variables y entornos


export DIR=/home/jeronimo/Build_WRF/LIBRARIES
export CC=gcc
export CXX=g++
export FC=gfortran
export CFLAGS=-m64
export F77=gfortran
export FFLAGS=-m64

Grabar y salir, luego en la carpeta LIBRARIES dar la orden:


source /home/jgv/.bashrc

tar -zxvf netcdf-4.1.3.tar.gz


cd netcdf-4.1.3
./configure --prefix=$DIR/netcdf --disable-dap --disable-netcdf-4 --disable-shared
make
make install
make[3]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/netcdf-4.1.3'
make[2]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/netcdf-4.1.3'
make[1]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/netcdf-4.1.3'
Luego agregar 2 lineas de "variables de entorno" al archivo .bashrc:

export PATH=$DIR/netcdf/bin:$PATH
export NETCDF=$DIR/netcdf
Grabar y salir, luego en la carpeta netcdf-4.1.3 dar la orden:
source /home/jeronimo/.bashrc
cd ..

tar -zxvf mpich-3.0.4.tar.gz


cd mpich-3.0.4
./configure --prefix=$DIR/mpich
make
make install
make[3]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/mpich-3.0.4/examples'
make[2]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/mpich-3.0.4/examples'
make[1]: se sale del directorio '/home/jgv/Build_WRF/LIBRARIES/mpich-3.0.4'
Luego agregar a ".bashrc", la línea:
export PATH=$DIR/mpich/bin:$PATH
Grabar, salir y dar la orden:
source /home/jeronimo/.bashrc
cd ..
Antes de configurar zlib, agregar a ".bashrc" las 2 líneas:
export LDFLAGS=-L$DIR/grib2/lib
export CPPFLAGS=-I$DIR/grib2/include

Grabar, salir y dar la orden:


source /home/jeronimo/.bashrc

tar -zxvf zlib-1.2.7.tar.gz


cd zlib-1.2.7
./configure --prefix=$DIR/grib2
make
make install
cd ..

tar -zxvf libpng-1.2.50.tar.gz


cd libpng-1.2.50
./configure --prefix=$DIR/grib2
make
make install
cd ..

tar -zxvf jasper-1.900.1.tar.gz


cd jasper-1.900.1
./configure --prefix=$DIR/grib2
make
make install
cd ..

PRUEBA DE COMPATIBILIDAD DE LIBRERIAS (Fortran, C, NETCDF, MPI).

Es necesario verificar que las libreriasesten aptas para trabbajar con el compilador que sera usado por el
WPS y WRF instalados.

cd TEST
wget http://www2.mmm.ucar.edu/wrf/OnLineTutorial/compile_tutorial/tar_files/Fortran_C_NETCDF_MPI_tests.tar

Prueba 1: Fortran +C+ NetCDF

tar -xvf Fortran_C_NETCDF_MPI_tests.tar


cp ${NETCDF}/include/netcdf.inc .
gfortran -c 01_fortran+c+netcdf_f.f
gcc -c 01_fortran+c+netcdf_c.c
gfortran 01_fortran+c+netcdf_f.o 01_fortran+c+netcdf_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf
./a.out

C function called by Fortran


Values are xx = 2.00 and ii = 1
SUCCESS test 1 fortran + c + netcdf

Prueba 2: Fortran +C+ NetCDF + MPI

cp ${NETCDF}/include/netcdf.inc .
mpif90 -c 02_fortran+c+netcdf+mpi_f.f
mpicc -c 02_fortran+c+netcdf+mpi_c.c
mpif90 02_fortran+c+netcdf+mpi_f.o 02_fortran+c+netcdf+mpi_c.o -L${NETCDF}/lib -lnetcdff -lnetcdf
mpirun ./a.out

C function called by Fortran


Values are xx = 2.00 and ii = 1
status = 2
SUCCESS test 2 fortran + c + netcdf + mpi

INSTALACION del procesador (WRF):

cd Build_WRF
wget http://www2.mmm.ucar.edu/wrf/src/WRFV3.6.TAR.gz
tar -zxvf WRFV3.6.TAR.gz
cd WRFV3
./configure
Elegir la opción: 34
34. x86_64 Linux, gfortran compiler with gcc (dmpar)
Luego opción 1, como respuesta a la pregunta Compile for nesting?

This installation of NetCDF is 64-bit


C compiler is 64-bit
Fortran compiler is 64-bit
It will build in 64-bit

./compile em_real >& compile.log &


tail -f compile.log

/bin/cp -f namelist.input namelist.input.backup ; fi ; \


/bin/rm -f namelist.input ; cp ../test/em_real/namelist.input . )
build started: lun mar 11 21:08:14 -05 2019
build completed: lun mar 11 21:15:43 -05 2019

Control + C

ls -las main/*.exe

31864 -rwxrwxr-x 1 jgv jgv 32627432 mar 11 21:15 main/ndown.exe


31316 -rwxrwxr-x 1 jgv jgv 32066304 mar 11 21:15 main/nup.exe
31748 -rwxrwxr-x 1 jgv jgv 32508544 mar 11 21:15 main/real.exe
31428 -rwxrwxr-x 1 jgv jgv 32181584 mar 11 21:15 main/tc.exe
36316 -rwxrwxr-x 1 jgv jgv 37186656 mar 11 21:15 main/wrf.exe

Todos de color verde

INSTALACION del preprocesador (WPS):

cd Build_WRF

wget http://www2.mmm.ucar.edu/wrf/src/WPSV3.6.TAR.gz
tar -zxvf WPSV3.6.TAR.gz
cd WPS
./clean

Editar .bashrc, adicionando:

export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
Luego grabar, salir y luego el comando:
source /home/jeronimo/.bashrc

./configure
Cuando para elegir la opción 1 (serial)

Configuration successful. To build the WPS, type: compile

Testing for NetCDF, C and Fortran compiler

This installation NetCDF is 64-bit


C compiler is 64-bit
Fortran compiler is 64-bit

Antes de compilar:

con kate configure.wps, verificar que WRF_DIR =../WRFV3


salir y continuar

./compile >& compile.log &


tail -f compile.log

Al finalizar: Ctrl + C
Luego:
ls -las *exe

Debe aparecer:
0 lrwxrwxrwx 1 jgv jgv 23 mar 11 22:05 geogrid.exe -> geogrid/src/geogrid.exe
0 lrwxrwxrwx 1 jgv jgv 23 mar 11 22:06 metgrid.exe -> metgrid/src/metgrid.exe
0 lrwxrwxrwx 1 jgv jgv 21 mar 11 22:05 ungrib.exe -> ungrib/src/ungrib.exe

cd ..

Instalacion de datos geogrid:


Entrar a la carpeta Build_WRF, descarga y descomprimir datos (topografía y categoría de usos de tierra).
se crea la carpeta geog,renombrarlo a: WPS_GEOG.
wget http://www2.mmm.ucar.edu/wrf/src/wps_files/geog_10m.tar.gz
tar -zxvf geog_10m.tar.gz
mv geog WPS_GEOG
cd wps
En el archivo namelist.wps modificar la ubicación de la carpeta WPS_GEOG.
kate namelist.wps
Colocar la ruta: '/home/jeronimo/Build_WRF/WPS_GEOG'
grabar y salir.
cd ..

INSTALACION del postprocesador (ARWpost):

ARWpost es un programa en fortran que lee archivos de entrada y salida de WRF-ARW y genera archivos
para GRADS.

cd Build_WRF
wget http://www2.mmm.ucar.edu/wrf/src/ARWpost_V3.tar.gz
tar -zxvf ARWpost_V3.tar.gz
cd ARWpost
Se observar lo siguiente:
arch clean configure fields.plt namelist.ARWpost scripts util
compile myLIST README src

Asumiendo que las variables de NETCDF han sido colocados en .bashrc, es posible configurar ARWpost.

./configure

Cuando para elegir la opción 3 (compilador gfortran). Y antes de proceder a compilar modificar el archivo
Makefile en src y el archivo configure.arwp.

Configuration successful. To build the ARWpost, type: compile

cd src
kate Makefile. Después de lib agregar: -lnetcdf -lnetcdff :

-L$(NETCDF)/lib -lnetcdf -lnetcdff -I$(NETCDF)/include -lnetcdf

cd ..
kate configure.arwp. En la liniea de CPP borrar -C y en la linea de CFLAGS anteponer -fPIC a -m64.

CFLAGS = -m64
CPP = /lib/cpp -C -P -traditiona

Luego proceder a compilar:


./compile
ls -las *exe

Debe aparecer lo siguiente:

0 lrwxrwxrwx 1 jgv jgv 15 mar 11 22:44 ARWpost.exe -> src/ARWpost.exe

en color celeste y verde respectivamente.

También podría gustarte