WRF+WPS 4.4 v1
commit
fad98794d6
@ -0,0 +1,45 @@
|
|||||||
|
# COMPILACIÒN DE WRF
|
||||||
|
|
||||||
|
Este instructivo permite compilar WRF v4.4 con HDF5.
|
||||||
|
|
||||||
|
## Activar entorno NIX
|
||||||
|
|
||||||
|
```
|
||||||
|
$ enable_nix
|
||||||
|
```
|
||||||
|
|
||||||
|
## Clonar este repositorio y bajar/compilar fuentes de WRF
|
||||||
|
|
||||||
|
```
|
||||||
|
$ git clone https://git.csc.gob.ar/tupac/wrf-nix.git
|
||||||
|
$ cd wrf-nix
|
||||||
|
$ nix-shell wrf.nix
|
||||||
|
# [esperar a que se active el entorno Nix]
|
||||||
|
# unpackPhase: función de Nix que baja y descomprime el fuente de WRF
|
||||||
|
# Necesario por unica vez
|
||||||
|
$ unpackPhase
|
||||||
|
$ cd WRF
|
||||||
|
$ ./configure
|
||||||
|
# Seleccionar opciones 34 y 1
|
||||||
|
$ ./compile -j 4 wrf
|
||||||
|
$ ./compile -j 4 em_real
|
||||||
|
$ exit
|
||||||
|
```
|
||||||
|
|
||||||
|
## Compilar WPS
|
||||||
|
|
||||||
|
A continuación podemos compilar WPS (desde la carpeta base del repo):
|
||||||
|
|
||||||
|
```
|
||||||
|
$ nix-shell wps.nix
|
||||||
|
$ [esperar a que se active el entorno Nix]
|
||||||
|
# unpackPhase: función de Nix que baja y descomprime el fuente de WPS
|
||||||
|
# Necesario por unica vez
|
||||||
|
$ unpackPhase
|
||||||
|
$ cd WPS-4.4
|
||||||
|
$ ./configure
|
||||||
|
# Seleccionar opcion 3, linux paralelo
|
||||||
|
$ ./compile
|
||||||
|
$ exit
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,41 @@
|
|||||||
|
#{ lib, stdenv, fetchurl, gfortran, mpi, jasper, netcdf, netcdf-fortran, zlib, removeReferencesTo}:
|
||||||
|
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
|
let netcdf-full = pkgs.buildEnv {
|
||||||
|
name = "netcdf+c+fortran";
|
||||||
|
paths = [
|
||||||
|
netcdf
|
||||||
|
netcdffortran
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "WPS";
|
||||||
|
version = "4.4";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://github.com/wrf-model/WPS/archive/refs/tags/v4.4.tar.gz";
|
||||||
|
sha256 = "sha256-/pyNippKu/gAsw5suzeGBMYEDkU29VlLji2uQ+lC4rM=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ m4 removeReferencesTo ];
|
||||||
|
buildInputs = [ mpi netcdf-full gfortran zlib jasper openmpi libpng gomp ];
|
||||||
|
dontAddPrefix=true;
|
||||||
|
env.NETCDF=netcdf-full;
|
||||||
|
env.JASPERLIB=jasper + "/lib";
|
||||||
|
env.JASPERINC=jasper + "/include";
|
||||||
|
env.WRF_DIR = "../WRF";
|
||||||
|
env.NIX_LDFLAGS = "-lnetcdff";
|
||||||
|
configurePhase= ''
|
||||||
|
bash -c "echo 35 | ./configure"
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase= ''
|
||||||
|
bash -c "./compile wrf"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase= ''
|
||||||
|
'';
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
#{ lib, stdenv, fetchurl, gfortran, mpi, jasper, netcdf, netcdffortran, zlib, removeReferencesTo}:
|
||||||
|
|
||||||
|
with import <nixpkgs> {};
|
||||||
|
|
||||||
|
let netcdf-full = pkgs.buildEnv {
|
||||||
|
name = "netcdf+c+fortran";
|
||||||
|
paths = [
|
||||||
|
netcdf
|
||||||
|
netcdffortran
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
|
||||||
|
gcc9Stdenv.mkDerivation {
|
||||||
|
pname = "WRF";
|
||||||
|
version = "4.4.2";
|
||||||
|
|
||||||
|
src = fetchurl {
|
||||||
|
url = "https://github.com/wrf-model/WRF/releases/download/v4.4.2/v4.4.2.tar.gz";
|
||||||
|
sha256 = "sha256-SIuZLo6ZRjfFjjxp6GmtBaz+eUGcAfvvat4fYk5Q3Do=";
|
||||||
|
};
|
||||||
|
|
||||||
|
nativeBuildInputs = [ m4 removeReferencesTo ];
|
||||||
|
buildInputs = [ mpi
|
||||||
|
netcdf-full
|
||||||
|
gfortran
|
||||||
|
zlib
|
||||||
|
jasper
|
||||||
|
openmpi
|
||||||
|
libpng
|
||||||
|
gomp
|
||||||
|
hdf5-mpi
|
||||||
|
hdf5-fortran];
|
||||||
|
dontAddPrefix=true;
|
||||||
|
env.HDF5=hdf5-mpi;
|
||||||
|
env.NETCDF=netcdf-full;
|
||||||
|
env.JASPERLIB=jasper + "/lib";
|
||||||
|
env.JASPERINC=jasper + "/include";
|
||||||
|
NIX_CFLAGS_COMPILE = "-Wno-format-security";
|
||||||
|
env.NIX_LDFLAGS = "-lnetcdff";
|
||||||
|
configurePhase= ''
|
||||||
|
bash -c "echo 34 | ./configure"
|
||||||
|
'';
|
||||||
|
|
||||||
|
buildPhase= ''
|
||||||
|
bash -c "./compile wrf"
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase= ''
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in New Issue