source: LMDZ6/branches/LMDZ_cdrag_LSCE/libf/phylmd/ecrad/radiation_io.F90 @ 5407

Last change on this file since 5407 was 3908, checked in by idelkadi, 4 years ago

Online implementation of the radiative transfer code ECRAD in the LMDZ model.

  • Inclusion of the ecrad directory containing the sources of the ECRAD code
    • interface routine : radiation_scheme.F90
  • Adaptation of compilation scripts :
    • compilation under CPP key CPP_ECRAD
    • compilation with option "-rad ecard" or "-ecard true"
    • The "-rad old/rtm/ecran" build option will need to replace the "-rrtm true" and "-ecrad true" options in the future.
  • Runing LMDZ simulations with ecrad, you need :
    • logical key iflag_rrtm = 2 in physiq.def
    • namelist_ecrad (DefLists?)
    • the directory "data" containing the configuration files is temporarily placed in ../libfphylmd/ecrad/
  • Compilation and execution are tested in the 1D case. The repository under svn would allow to continue the implementation work: tests, verification of the results, ...
File size: 2.0 KB
Line 
1! radiation_io.F90 - Provides logging and abort functionality
2!
3! (C) Copyright 2015- ECMWF.
4!
5! This software is licensed under the terms of the Apache Licence Version 2.0
6! which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
7!
8! In applying this licence, ECMWF does not waive the privileges and immunities
9! granted to it by virtue of its status as an intergovernmental organisation
10! nor does it submit to any jurisdiction.
11!
12! Author:  Robin Hogan
13! Email:   r.j.hogan@ecmwf.int
14!
15!  This file provides an interface to the provision of file units used
16!  for logging (nulout and nulerr) and for reading data files
17!  (nulrad), as well as an abort routine that should do clean-up
18!  appropriate for the environment in which the radiation scheme is
19!  embedded.
20!
21!  Rewrite this file as appropriate if the radiation scheme is to be
22!  embedded into a model other than the ECMWF Integrated Forecasting
23!  System.
24
25module radiation_io
26
27  ! In the IFS, nulout is equivalent to standard output but only
28  ! output from the primary node will be logged, while nulerr is
29  ! equivalent to standard error, and text sent to this unit from any
30  ! node will be logged. Normally, nulerr should only be used before
31  ! calling radiation_abort.
32  use yomlun_ifsaux, only : nulout, nulerr
33
34  implicit none
35  public
36
37  ! This unit may be used for reading radiation configuration files,
38  ! but should be closed as soon as the file is read
39  integer :: nulrad = 25
40
41contains
42
43  ! Abort the program with optional error message. Normally you would
44  ! log details of the error to nulerr before calling this subroutine.
45  subroutine radiation_abort(text)
46    character(len=*), intent(in), optional :: text
47    if (present(text)) then
48      write(nulerr,'(a)') text
49#ifdef __PGI
50      stop 1
51#else
52      error stop 1
53#endif
54    else
55#ifdef __PGI
56      stop 'Error in radiation scheme'
57#else
58      error stop 'Error in radiation scheme'
59#endif
60    end if
61  end subroutine radiation_abort
62
63end module radiation_io
Note: See TracBrowser for help on using the repository browser.