Commit 2da975e0 authored by ronesy's avatar ronesy
Browse files

Change to read_noaa for averaging flask pairs

parent 766b9644
......@@ -84,8 +84,6 @@ subroutine read_noaa(settings, jd, nr, nobs, obs)
call caldate(jd, jjjjmmdd, hhmiss)
eomday = calceomday(jjjjmmdd/100)
print*, filelist
! find file matching receptor name
do n = 1, nfiles
do i = 1, len_trim(filelist(n))-2
......@@ -136,7 +134,7 @@ subroutine read_noaa(settings, jd, nr, nobs, obs)
i = i + 1
read(args(n),*) temp(i)
end do
n = 27
n = 26
i = i + 2
read(args(n),*,iostat=ierr) temp(i)
if ( ierr.ne.0 ) print*, 'WARNING: file does not appear to contain sample height -> using altitude'
......@@ -189,19 +187,30 @@ subroutine read_noaa(settings, jd, nr, nobs, obs)
! average flask pairs
i = 1
j = 0
dt = 10./(24.*60.)
dt = 10./(24.*60.) ! within 10 min -> consider as pair
if ( nobs.gt.1 ) then
do while( i.lt.nobs )
do while( i.le.nobs )
j = j + 1
if ( jdobs(i+1).lt.(jdobs(i) + dt) ) then
! this is a pair
dataout(j,1) = jdobs(i)
dataout(j,2) = 0.5*(concobs(i) + concobs(i+1))
dataout(j,3) = errobs(i)
dataout(j,4) = latobs(i)
dataout(j,5) = lonobs(i)
dataout(j,6) = altobs(i)
i = i + 2
if ( i.lt.nobs ) then
if ( jdobs(i+1).lt.(jdobs(i) + dt) .and. altobs(i+1).eq.altobs(i) ) then
! this is a pair
dataout(j,1) = jdobs(i)
dataout(j,2) = 0.5*(concobs(i) + concobs(i+1))
dataout(j,3) = errobs(i)
dataout(j,4) = latobs(i)
dataout(j,5) = lonobs(i)
dataout(j,6) = altobs(i)
i = i + 2
else
! not a pair
dataout(j,1) = jdobs(i)
dataout(j,2) = concobs(i)
dataout(j,3) = errobs(i)
dataout(j,4) = latobs(i)
dataout(j,5) = lonobs(i)
dataout(j,6) = altobs(i)
i = i + 1
endif
else
! not a pair
dataout(j,1) = jdobs(i)
......
......@@ -14,9 +14,11 @@
# To run tests reference to current directory
DIR=$PWD
LEN=`expr length $DIR - 13`
LEN=`expr length $DIR - 11`
ROOTDIR=${DIR:0:$LEN}
echo ${ROOTDIR}
#---------------------------------------------------
# User settings
......@@ -26,9 +28,9 @@ TIMELIM=12:00:00
PARTITION="nilu"
EXENAME=FP_ecmwf_gfortran
METEO=ecmwf
DIRFLEX=/home/rthompson/REPOS/GITHUB/FLEXPART/
DIROPTIONS=${ROOTDIR}TEST_INPUT/FLEXPART/GHG/NEST/
STNLIST=(SSL)
DIRFLEX=${ROOTDIR}TEST_CASE_CH4/FLEXPART/
DIROPTIONS=${ROOTDIR}TEST_CASE_CH4/FP_FILES/
STNLIST=(PAL)
MONLIST=(01)
YEAR=2012
......
......@@ -4,6 +4,8 @@ partition=debug
settings_files='./SETTINGS_ghg'
#---------------------------------------------------
cp ../../prep_flexpart/prep_flexpart .
cat <<EOF > run_job.sh
#!/bin/bash
./prep_flexpart ${settings_files}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment