#! /bin/csh -f
#SBATCH -p gpu
#SBATCH -t 24:00:00
#SBATCH -n 1
#SBATCH -c 1
#SBATCH --gid=romo
#SBATCH --account=romo




# setenv compiler intel
# setenv compilerVrsn 17.0
# source /work/ROMO/users/kpc/merps/hr2day/config_cmaq.csh

 setenv YEAR 2024
 setenv GRID 12US1
# setenv SCEN base2022_CO2test

foreach SCEN ( tempo  ) 
#foreach SCEN ( baseline2023_r2_altEMIS baseline2023_r2_altO3drydep baseline2023_r2_altO3wetdep baseline2023_r2_altAEROatt ) 
foreach YYYY (2024)
foreach MM ( 06 )
#foreach DD (01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31)
foreach DD (02 03 04 05 06 07 08)

#> define species (format: "Name, units, From_species, Operation")
#>  operations : {SUM, AVG, MIN, MAX, @MAXT, MAXDIF, 8HRMAX, SUM06}
# setenv OZONE "O3" #variable from which the @8HRMAXO3 bases the 8hr max
 setenv SPECIES_1 "NO2_VERTICAL_CO,,NO2_VERTICAL_CO,AVG"

#> location of time zone data file, tz.csv (this is a required input file
#> when using OLAYTYPE HOURLY since hourly observations need to be shifted
#> from local time to GMT)
 setenv TZFILE /work/MOD3EVAL/kbaker/projects/qrt/hr2day/tz.csv
#> set input and output files
 setenv INFILE /work/MOD3EVAL/kbaker/data/satellite/tempo/xtempo_${GRID}_NO2_${YYYY}$MM$DD.nc
          #[Add location of input file, e.g. COMBINE_ACONC file.]
 setenv OUTFILE /work/MOD3EVAL/kbaker/data/satellite/tempo/combine_xtempo.$YYYY$MM$DD.$GRID.$SCEN.ncf
 rm -f $OUTFILE

#> Projection sphere type used by I/OAPI (use type #20 to match WRF/CMAQ)
 setenv IOAPI_ISPH 20
#> set to use local time (default is GMT)
 setenv USELOCAL Y
#> set to use daylight savings time (default is N)
 setenv USEDST N
#> partial day calculation (computes value for last day)
 setenv PARTIAL_DAY Y
#> constant hour offset between desired time zone and GMT (default is 0)
 setenv HROFFSET 0
#> starting hour for daily metrics (default is 0)
 setenv START_HOUR 12
#> ending hour for daily metrics (default is 23)
 setenv END_HOUR 13
#> Number of 8hr values to use when computing daily maximum 8hr ozone.
#> Allowed values are 24 (use all 8-hr averages with starting hours 
#> from 0 - 23 hr local time) and 17 (use only the 17 8-hr averages
#> with starting hours from 7 - 23 hr local time)
 setenv HOURS_8HRMAX 24
# setenv HOURS_8HRMAX 17

#> Executable call:
 setenv BINDIR /work/ROMO/users/kpc/cmaq/CMAQ54/POST/hr2day/scripts/BLD_hr2day_v54_intel21.4
 setenv EXEC hr2day_v54.exe

 ${BINDIR}/${EXEC}

 end #loop over months
 end
 end
 end

 exit()


