1 | !********************************************************************** |
---|
2 | ! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010 * |
---|
3 | ! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa, * |
---|
4 | ! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann * |
---|
5 | ! * |
---|
6 | ! This file is part of FLEXPART. * |
---|
7 | ! * |
---|
8 | ! FLEXPART is free software: you can redistribute it and/or modify * |
---|
9 | ! it under the terms of the GNU General Public License as published by* |
---|
10 | ! the Free Software Foundation, either version 3 of the License, or * |
---|
11 | ! (at your option) any later version. * |
---|
12 | ! * |
---|
13 | ! FLEXPART is distributed in the hope that it will be useful, * |
---|
14 | ! but WITHOUT ANY WARRANTY; without even the implied warranty of * |
---|
15 | ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
---|
16 | ! GNU General Public License for more details. * |
---|
17 | ! * |
---|
18 | ! You should have received a copy of the GNU General Public License * |
---|
19 | ! along with FLEXPART. If not, see <http://www.gnu.org/licenses/>. * |
---|
20 | !********************************************************************** |
---|
21 | |
---|
22 | subroutine readOHfield |
---|
23 | |
---|
24 | !***************************************************************************** |
---|
25 | ! * |
---|
26 | ! Reads the OH field into memory * |
---|
27 | ! * |
---|
28 | ! AUTHOR: R.L. Thompson, Nov 2014 * |
---|
29 | ! * |
---|
30 | ! UPDATES: * |
---|
31 | ! 03/2018 SEC: Converted original netCDF files to binary format * |
---|
32 | !***************************************************************************** |
---|
33 | ! * |
---|
34 | ! Variables: * |
---|
35 | ! * |
---|
36 | ! path(numpath) contains the path names * |
---|
37 | ! lonOH(nxOH) longitude of OH fields * |
---|
38 | ! latOH(nyOH) latitude of OH fields * |
---|
39 | ! altOH(nzOH) altitude of OH fields * |
---|
40 | ! etaOH(nzOH) eta-levels of OH fields * |
---|
41 | ! OH_field(nxOH,nyOH,nzOH,m) OH concentration (molecules/cm3) * |
---|
42 | ! * |
---|
43 | ! * |
---|
44 | !***************************************************************************** |
---|
45 | |
---|
46 | use oh_mod |
---|
47 | use par_mod |
---|
48 | use com_mod |
---|
49 | |
---|
50 | implicit none |
---|
51 | |
---|
52 | integer :: i,j,k,l,ierr |
---|
53 | real, dimension(:), allocatable :: etaOH |
---|
54 | |
---|
55 | ! real, parameter :: gasct=8.314 ! gas constant |
---|
56 | ! real, parameter :: mct=0.02894 ! kg mol-1 |
---|
57 | ! real, parameter :: g=9.80665 ! m s-2 |
---|
58 | ! real, parameter :: lrate=0.0065 ! K m-1 |
---|
59 | real, parameter :: scalehgt=7000. ! scale height in metres |
---|
60 | |
---|
61 | |
---|
62 | open(unitOH,file=trim(ohfields_path) & |
---|
63 | //'OH_FIELDS/OH_variables.bin',status='old', & |
---|
64 | form='UNFORMATTED', iostat=ierr, convert='little_endian') |
---|
65 | |
---|
66 | if(ierr.ne.0) then |
---|
67 | write(*,*) 'Cannot read binary OH fields in ',trim(ohfields_path)//'OH_FIELDS/OH_variables.bin' |
---|
68 | stop |
---|
69 | endif |
---|
70 | |
---|
71 | read(unitOH) nxOH |
---|
72 | read(unitOH) nyOH |
---|
73 | read(unitOH) nzOH |
---|
74 | write(*,*) nxOH,nyOH,nzOH |
---|
75 | |
---|
76 | ! allocate variables |
---|
77 | allocate(lonOH(nxOH)) |
---|
78 | allocate(latOH(nyOH)) |
---|
79 | allocate(etaOH(nzOH)) |
---|
80 | allocate(altOH(nzOH)) |
---|
81 | allocate(OH_field(nxOH,nyOH,nzOH,12)) |
---|
82 | allocate(OH_hourly(nxOH,nyOH,nzOH,2)) |
---|
83 | |
---|
84 | read(unitOH) (lonjr(i),i=1,360) |
---|
85 | read(unitOH) (latjr(i),i=1,180) |
---|
86 | read(unitOH) (((jrate_average(i,j,k),i=1,360),j=1,180),k=1,12) |
---|
87 | read(unitOH) (lonOH(i),i=1,nxOH) |
---|
88 | read(unitOH) (latOH(i),i=1,nyOH) |
---|
89 | read(unitOH) (lonOH(i),i=1,nxOH) |
---|
90 | |
---|
91 | read(unitOH) (altOH(i),i=1,nzOH) |
---|
92 | read(unitOH) ((((OH_field(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,12) |
---|
93 | read(unitOH) ((((OH_hourly(i,j,k,l),i=1,nxOH),j=1,nyOH),k=1,nzOH),l=1,2) |
---|
94 | |
---|
95 | end subroutine readOHfield |
---|
96 | |
---|