1 | ! SPDX-FileCopyrightText: FLEXPART 1998-2019, see flexpart_license.txt |
---|
2 | ! SPDX-License-Identifier: GPL-3.0-or-later |
---|
3 | |
---|
4 | subroutine openreceptors |
---|
5 | |
---|
6 | !***************************************************************************** |
---|
7 | ! * |
---|
8 | ! This routine opens the receptor output files and writes out the receptor * |
---|
9 | ! names and the receptor locations. The receptor output files are not * |
---|
10 | ! closed, but kept open throughout the simulation. Concentrations are * |
---|
11 | ! continuously dumped to these files. * |
---|
12 | ! * |
---|
13 | ! Author: A. Stohl * |
---|
14 | ! * |
---|
15 | ! 7 August 2002 * |
---|
16 | ! * |
---|
17 | !***************************************************************************** |
---|
18 | ! * |
---|
19 | ! Variables: * |
---|
20 | ! numreceptor actual number of receptor points specified * |
---|
21 | ! receptornames names of the receptor points * |
---|
22 | ! xreceptor,yreceptor coordinates of the receptor points * |
---|
23 | ! * |
---|
24 | !***************************************************************************** |
---|
25 | |
---|
26 | use par_mod |
---|
27 | use com_mod |
---|
28 | |
---|
29 | implicit none |
---|
30 | |
---|
31 | integer :: j |
---|
32 | |
---|
33 | ! Open output file for receptor points and write out a short header |
---|
34 | ! containing receptor names and locations |
---|
35 | !****************************************************************** |
---|
36 | |
---|
37 | if (numreceptor.ge.1) then ! do it only if receptors are specified |
---|
38 | |
---|
39 | ! Concentration output |
---|
40 | !********************* |
---|
41 | |
---|
42 | if ((iout.eq.1).or.(iout.eq.3).or.(iout.eq.5)) then |
---|
43 | open(unitoutrecept,file=path(2)(1:length(2))//'receptor_conc', & |
---|
44 | form='unformatted',err=997) |
---|
45 | write(unitoutrecept) (receptorname(j),j=1,numreceptor) |
---|
46 | write(unitoutrecept) (xreceptor(j)*dx+xlon0, & |
---|
47 | yreceptor(j)*dy+ylat0,j=1,numreceptor) |
---|
48 | endif |
---|
49 | |
---|
50 | ! Mixing ratio output |
---|
51 | !******************** |
---|
52 | |
---|
53 | if ((iout.eq.2).or.(iout.eq.3)) then |
---|
54 | open(unitoutreceptppt,file=path(2)(1:length(2))//'receptor_pptv', & |
---|
55 | form='unformatted',err=998) |
---|
56 | write(unitoutreceptppt) (receptorname(j),j=1,numreceptor) |
---|
57 | write(unitoutreceptppt) (xreceptor(j)*dx+xlon0, & |
---|
58 | yreceptor(j)*dy+ylat0,j=1,numreceptor) |
---|
59 | endif |
---|
60 | endif |
---|
61 | |
---|
62 | return |
---|
63 | |
---|
64 | |
---|
65 | 997 write(*,*) ' #### FLEXPART MODEL ERROR! THE FILE #### ' |
---|
66 | write(*,*) ' #### receptor_conc #### ' |
---|
67 | write(*,*) ' #### CANNOT BE OPENED. #### ' |
---|
68 | stop |
---|
69 | |
---|
70 | 998 write(*,*) ' #### FLEXPART MODEL ERROR! THE FILE #### ' |
---|
71 | write(*,*) ' #### receptor_pptv #### ' |
---|
72 | write(*,*) ' #### CANNOT BE OPENED. #### ' |
---|
73 | stop |
---|
74 | |
---|
75 | end subroutine openreceptors |
---|