Urban-Meteorology-Reading / WRF-SUEWS

WRF-SUEWS coupling project
https://wrf-suews.readthedocs.org
MIT License
5 stars 2 forks source link
suews wrf

WRF-SUEWS

WRF-SUEWS coupling project

Make sure to use the following commands after cloning the repo:

git submodule init
git submodule update

These commands update SUEWS repo associated with WRF-SUEWS. Currently, it is an older version of SUEWS than the most up-to-date one.

Guide for Compilation and Simulation

JASMIN (as of 04 May 2022)

Firstly make sure to use same compiler (preferably INTEL) for installing pre-requisite libraries and WRF model compilation. To load intel compiler setting on JASMIN type module load intel/20.0.0

Dependencies

Please follow the official guide here for other libraries requirement for the WRF compilation.

Setting WRF-SUEWS environment

Set the wrf-suews environment by typing conda env create --file=wrf_suews.yml and activate it by conda activate wrf-suews in the WRF-SUEWS directory.

Steps

  1. Go to coupling-automator folder, and type make

  2. It creates the compilation-YYYYMMDD folder to compile (name of the folder depends on what you specify here)

  3. In the created folder, type ./configure This is for configuration of WRF-SUEWS. Choose number 15 for the compiler (as of WRFv4 this refers to standard intel compiler) and basic option for the nesting.

  4. Then you need compile the code: ./compile em_real >& log.compile. For this, you can submit the job file by sbatch sb-compile.sh in the compilation folder (specified by path_working in automate_main.py).

  5. After compilation of the code, you need to transfer all the wrfinput_d0* files generated with WSPS to the location of main run (usually ./test/em_real OR ./run) (rename the files to the original names by removing .suews from the filenames). Also include the boundary condition wrfbdy_d01 file in the run directory.

  6. You also need to copy namelist.suews to the same location.

  7. Use LANDUSE.TBL in ./test/em_real to change the albedo associated with Urban areas (number 13 for MODIFIED_IGBP_MODIS_NOAH for both winter and summer. By default it is 15% (0.15). In London case, it is changed to 11% (0.11) based on Ward et al. 2016)

  8. namelist.input should also be modified to be consistent for WRF-SUEWS. See examples here (specially the sf_surface_physics = 9 which specifies to use SUEWS as the LSM).

  9. The rest of steps, are similar to usual WRF runs (running WRF-SUEWS)

Apple M1 chip (as of 17 Nov 2023)

Platform and Compiler

Darwin Kernel Version 23.1.0: Mon Oct  9 21:27:24 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6000 arm64

GNU Fortran (Homebrew GCC 13.2.0) 13.2.0

Notes

Due to the newer version of GCC, the compilation of WRF-SUEWS is not straightforward. The following steps are required to compile WRF-SUEWS on Apple M1 chip.

  1. use homebrew to install gcc-13.2.0 and netcdf

    brew install gcc@13.2.0 netcdf-c netcdf-fortran
  2. change GCC to the homebrew version: locate the gcc-13.2.0

    which gcc-13

set symlink to the gcc-13.2.0

ln -s /opt/homebrew/bin/gcc-13 /usr/local/bin/gcc
  1. set the environment variables for netcdf

    export NETCDF=/opt/homebrew/

    NB. this is set at the root of homebrew to avoid the error of "netcdf.inc" not found.

  2. generate compilation working directory

    cd coupling-automator
    make
  3. configure WRF-SUEWS settings

    cd compilation-20211018 % this is the directory generated by make, the date part may be different
    ./configure

    choose 15 for serial gcc/gfortran compiler

  4. modify configure.wrf to use the correct compiler flags

note the following lines in configure.wrf

FCBASEOPTS      =       $(FCBASEOPTS_NO_G) $(FCDEBUG)

modify it by adding more flags

FCBASEOPTS      =       $(FCBASEOPTS_NO_G) $(FCDEBUG) -fallow-invalid-boz -fallow-argument-mismatch
  1. compile WRF-SUEWS
    ./compile em_real >& log.compile

Pre-processing using WPS

To generate the original wrfinput files (before processing them for WRF-SUEWS), you should follow here. After generating wrfinput and wrfbdy, you need to follow pre-processing instructions to modify the input file suitbale for WRF-SUEWS runs

SUEWS specific pre-processing using WRF-SUEWS preprocessing system (WSPS)

Please refer to this instruction for WRF-SUEWS preprocessing system (WSPS).