Skip to content
Snippets Groups Projects
Commit 2da975e0 authored by ronesy's avatar ronesy
Browse files

Change to read_noaa for averaging flask pairs

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