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