= Radiation models = PALM offers a built-in simple and fast radiation model for clear sky conditions. Moreover, an interface allows for using the [http://rtweb.aer.com/rrtm_frame.html RRTMG] code. == Constant radiation == Not really being a radiation model, this option allows for prescribing the net radiation at the surface (e.g. as driving for the [wiki:doc/tec/lsm land surface model]). The user can use the user interface in order to modify the net radiation during the run. For more information, see [wiki:doc/app/radpar#net_radiation net_radiation]. == Simple clear sky radiation == A simple clear sky radiation model can be used for simulations without clouds and highly-parametrized radiation fluxes. == RRTMG == Since r1585 PALM can be used in combination with the [http://rtweb.aer.com/rrtm_frame.html RRTMG] radiation code. The RRTMG source code is shipped along with PALM, but it is not part of the model (this means that RRTMG is put under a difference licence than PALM, which e.g. forbids reselling of the code). Unlike most embedded modules in PALM, the RRTMG is thus used as external library and linked to the default PALM code. This in turn means that RRTMG must be installed in advance on the host where PALM shall be executed. The next section explains the installation of RRTMG and how to use it in PALM. Please note that RRTMG requires to use the netCDF data format. === Installation === The RRTMG source code for creating an external library can be found under [source:palm/trunk/LIB/rrtmg trunk/LIB/rrtmg]. It is accompanied by an installation script called [source:palm/trunk/LIB/rrtmg/install_rrtmg install_rrtmg]. In order to install RRTMG, perform the following steps: 1. Copy all files from [source:palm/trunk/LIB/rrtmg trunk/LIB/rrtmg] to the host where PALM/RRTMG shall be executed. 2. Open [source:palm/trunk/LIB/rrtmg/install_rrtmg install_rrtmg] and modify the following lines: {{{ compiler_name="mpif90" fopts="-fltconsistency -O3 -cpp -r8 -nbs -convert little_endian -I /muksoft/packages/netcdf/4_intel/include" fopts_trace="-fpe0 -C -check nooutput_conversion -debug -traceback -g -w -xT -O0 -I /muksoft/packages/netcdf/4_intel/include" install_path="$HOME/palm/rrtmg" compile_static=true compile_shared=true compile_static_debug=false compile_shared_debug=false }}} For a proper configuration, see your .mrun.config file for the respective computer architecture where RRTMG shall be installed. fopts_trace is only required if you want to have debug options enabled. Use the switch parameters compile_static=true, compile_shared=true, compile_static_debug=false, and compile_shared_debug=false to set flags for compilation of RRTMG as static library, shared library (recommended), static library with debug options (recommended), and shared library with debug options, respectively. Save your changes. 3. Execute [source:palm/trunk/LIB/rrtmg/install_rrtmg install_rrtmg] with option "-p", which defines the path where the library shall be installed, e.g.: {{{ ./install_rrtmg -p $HOME/lib/rrtmg }}} The script will create up to four directories depening on the setting of the flag parameters (see above), each including one installation of RRTMG: {{{ $HOME/lib/rrtmg/shared $HOME/lib/rrtmg/shared_trace $HOME/lib/rrtmg/static $HOME/lib/rrtmg/static_trace }}} with each directory having the following subdirectories: {{{ /include /lib }}} 4. Open your .mrun.config file and add {{{-D__rrtmg}}} to {{{%cpp_options}}} of the host where PALM/RRTMG shall be used. Moreover, add the path to the library to {{{%fopts}}} and {{{%lopts}}}, e.g. (here for lcmuk) {{{ %fopts -fpe0:-O3:-cpp:-fp-model:source:-I:/home/user/lib/rrtmg/shared/include lcmuk parallel rrtmg %lopts -fpe0:-O3:-cpp:-fp-model:source:-L/home/user/lib/rrtmg/shared/lib:-lrrtmg lcmuk parallel rrtmg }}} when a shared RRTMG library was installed under "/home/user/lib/rrtmg/shared". A template file including hosts lcmuk and lccrayh/lccrayb are available [http://palm.muk.uni-hannover.de/browser/palm/trunk/SCRIPTS/.mrun.config.imuk_hlrnIII_rrtmg here] Also add the following line to the list of input files (in:locopt can be modified to meet the needs of the user): {{{ rrtmg_lw.nc in:locopt d3#:d3f $base_data/$fname/INPUT _rlw nc rrtmg_sw.nc in:locopt d3#:d3f $base_data/$fname/INPUT _rsw nc RAD_SND_DATA in:locopt d3#:d3f $base_data/$fname/INPUT _rsnd nc }}} 5. Recompile PALM for the respective host. The RRTMG library will be included either as static or shared library, depending on your configuration. 6. To be able to use RRTMG, the LD_LIBRARY_PATH variable has to be extended by the path where RRTMG library (plus "/lib" added) was installed. For convenience, setting should be done in the respective profile of the users default shell (e.g. in .profile, if ksh is used), e.g.: {{{ export LD_LIBRARY_PATH=$HOME/lib/rrtmg/shared/lib:$LD_LIBRARY_PATH }}} when RRTMG was installed as shared library under "$HOME/lib/rrtmg/shared/". You may have to login again in order to activate the profile settings. === Job preparation === RRTMG requires various vertical profile data that must be provided in the INPUT directory of the job and labeled with underscore _rsw and _rlw, respectively. The required data format is NetCDF. Standard profiles are shipped with the RRTMG library and are located under [source:palm/trunk/LIB/rrtmg/data trunk/LIB/rrtmg/data]. Additionally, the user can overwrite the standard trace gas profiles by adding a third NetCDF file labelled as _rsnd that must follow the same data structure as the standard files. The INPUT directory should then contain at least the following files: {{{ jobname_p3d jobname_rlw (e.g. a copy of rrtmg_lw.nc) jobname_rsw (e.g. a copy of rrtmg_sw.nc) }}} and optionally {{{ jobname_rsnd (trace gas sounding data provided by the user) }}} The _p3d file should contain a NAMELIST for radiation, e.g.: {{{ &radiation_par radiation_scheme = 'rrtmg', lambda = 0.0, albedo_type = 0, day_init = 287, time_utc_init = 28800.0, dt_radiation = 60.0, albedo_lw_dir = 0.2, albedo_lw_dif = 0.2, albedo_sw_dir = 0.2, albedo_sw_dif = 0.2, / }}} A complete example file can be found [wiki:doc/app/examples/rrtmg here].