#!/bin/csh #ulimit -s unlimited set echo set EXPNAME = CONUS4K_d02_201607 # Used for emission data [jls] set NPROCS = 400 #was 320 # ##### begin user define area ##### # added # set CLOBBER_DATA = TRUE #set DISP = delete # Set Start and End Days for looping set start_year = 2016 set end_year = 2016 set start_month = 6 set end_month = 6 set start_day = 22 set end_day = 22 set cycle = 0 set firstday = 20160622 set STTIME = $cycle # beginning GMT time (HHMMSS) set NSTEPS = 240000 # time duration (HHMMSS) for this run set TSTEP = 010000 # output time step interval (HHMMSS) set version = 3852 set MECH = cb6r3_ae6_aq set resolution = 4km setenv NZ 35 # Vertical extent # Set Working, Input, and Output Directories set ROOT_DIR = /projects/b1045/wrf-cmaq set WRF_DIR = $ROOT_DIR/WRFV38_BIGBOY #? # WRF source code directory set INPDIR = $ROOT_DIR/input # input data path set OMIpath = $WRF_DIR/cmaq # path optics related data files set OUTPUT_ROOT = $ROOT_DIR/output/CONUS4K # output root directory set NMLpath = $WRF_DIR/cmaq # path with *.nml file mechanism dependent set NMLpath2 = $NMLpath # path with Species_Table_TR_0.nml file # Configuration Options set NUM_LAND_USE_TYPE = 40 # MODIS is 20, USGS is 24, NLCD is 50 # make sure the script contains num_land_cat in the physics section set cont_from_spinup_run = F # indicates whether a wrf spinup run prior to the twoway model run set radt = 10 # radiation module time step [min] setenv RUN_CMAQ_DRIVER T # [F] setenv DO_SW_CAL T # [F] setenv DO_LW_CAL F # [F] setenv WRF_CMAQ_FREQ 10 # switch? 16? # run n wrf step and then 1 cmaq step [1] setenv CREATE_PHYSICAL_FILE F # [F] setenv FILE_TIME_STEP 10000 # in hhmmss format setenv WRF_COL_DIM 1168 # wrf west_east_stag setenv WRF_ROW_DIM 739 # wrf south_north_stag setenv WRF_LAY_DIM 36 # wrf bottom_top_stag setenv CMAQ_COL_DIM 1155 setenv CMAQ_ROW_DIM 726 setenv TWOWAY_DELTA_X 6 setenv TWOWAY_DELTA_Y 6 setenv WRF_LC_REF_LAT 40.0 # WRF Lambert conformal reference latitude setenv CTM_TURN_ON_PV N # turn on/off PV [N] setenv SD_TIME_SERIES F # sub domain time series output option [F] setenv SD_SCOL 241 # sub domain time series starting column setenv SD_ECOL 248 # sub domain time series ending column setenv SD_SROW 160 # sub domain time series starting row setenv SD_EROW 169 # sub domain time series ending row setenv SD_CONC_SPCS "NO2 NO O3 NO3 CO ASO4J ASO4I ANH4J ANH4I ANO3J ANO3I AORGAJ AORGAI AORGPAJ AORGPAI AORGBJ AORGBI AECJ AECI A25J A25I ACORS ASEAS ASOIL" # sub domain time series species subset list # CMAQ model setup # User define species subset for ACONC, CONC and AVG_PMDIAG files #set ACONC_SPC_LIST = (ALD2 ALDX CO ETH ETHA FORM H2O2 HNO3 HONO OH \ # HO2 IOLE ISOP N2O5 NH3 NO NO2 NO3 PAN PANX \ # PNA CRON CRNO CRN2 CRPX OPAN O3 OLE PAR \ # SO2 SULF TERP TOL ETOH XYL AFEJ AALJ ASIJ ATIJ \ # ACAJ AMGJ AKJ AMNJ ASEACAT ASOIL ACORS ACLI ACLJ ACLK \ # AECI AECJ ANAJ ANAI ASO4I ASO4J ASO4K ANO3I ANO3J ANO3K \ # ANH4I ANH4J ANH4K AOTHRI AOTHRJ AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J \ # ATOL3J ABNZ1J ABNZ2J ABNZ3J AISO1J AISO2J AISO3J ATRP1J ATRP2J ASQTJ \ # AALKJ AORGCJ AOLGBJ AOLGAJ APOCI APOCJ APNCOMI APNCOMJ) #setenv AVG_CONC_SPCS "$ACONC_SPC_LIST" # species for integral average conc setenv AVG_CONC_SPCS "ALL" # parse down -- look at combine script to figure out what pm2.5 components are needed #set CONC_SPC_LIST = (NO2 NO O3 NO3 OH HO2 N2O5 HNO3 HONO PNA \ # H2O2 XO2 XO2N ROOH FORM ALD2 ALDX PAR CO \ # PAN PANX OLE ETH IOLE TOL TOLRO2 OPAN CRON CRNO \ # CRN2 CRPX XYL XYLRO2 ISOP TERP SO2 SULF ETOH ETHA \ # BENZENE BENZRO2 SESQ ASO4J ASO4I ANH4J ANH4I ANO3J ANO3I AALKJ \ # AXYL1J AXYL2J AXYL3J ATOL1J ATOL2J ATOL3J ABNZ1J ABNZ2J ABNZ3J ATRP1J \ # ATRP2J AISO1J AISO2J ASQTJ AORGCJ APOCJ APOCI APNCOMJ APNCOMI AECJ \ # AECI AOTHRJ AOTHRI AFEJ AALJ ASIJ ATIJ ACAJ AMGJ AKJ \ # AMNJ ACORS ASOIL NUMATKN NUMACC NUMCOR SRFATKN SRFACC SRFCOR AH2OJ \ # AH2OI ANAJ ANAI ACLJ ACLI ASEACAT ACLK ASO4K ANH4K ANO3K \ # AH2OK AISO3J AOLGAJ AOLGBJ NH3) #setenv CONC_SPCS "$CONC_SPC_LIST" #setenv AVG_PMDIAG_SPCS "STDEVCOR RH GAMMA_N2O5K M3COR_DRY" setenv CONC_SPCS "" # 3d stuff -- o3, pm? # User define layer subset #setenv CONC_BLEV_ELEV " 1 ${NZ}" # CONC file layer range; comment to write all layers to CONC setenv ACONC_BLEV_ELEV " 1 1" # layer range for integral average conc # User define PA grid setenv CTM_PROCAN N # use process analysis [N] setenv PA_BCOL_ECOL "30 100" # process analysis (and irr) column ranges setenv PA_BROW_EROW "10 50" # process analysis (and irr) row ranges setenv PA_BLEV_ELEV "1 5" # process analysis (and irr) layer ranges # General CMAQ setup setenv CTM_MAXSYNC 300 # max sync time step (sec) [720] setenv CTM_MINSYNC 30 # min sync time step (sec) [60] setenv SIGMA_SYNC_TOP 0.7 # top sigma level thru which sync step determined [0.7] #setenv ADV_HDIV_LIM 0.95 # maximum horiz. div. limit for adv step adjust [0.9] setenv CTM_ADV_CFL 0.95 # max CFL [0.75] #setenv RB_ATOL 1.0E-09 # global ROS3 solver abs tol [1.0E-07] setenv AVG_FILE_ENDTIME Y # override default beginning average file timestamp [N] setenv CTM_CKSUM Y # cksum report [Y] setenv CTM_WB_DUST Y # use inline windblown dust emissions [Y] setenv CTM_ERODE_AGLAND N # use agricultural activity for windblown dust [N] ignore if CTM_WB_DUST = N setenv CTM_WBDUST_BELD NLCD40 # landuse database for identifying dust source regions [BELD3] ignore if CTM_WB_DUST = N setenv CTM_LTNG_NO Y # turn on lightning NOx [N] setenv CTM_WVEL N # save derived vertical velocity component to conc file [N] setenv KZMIN Y # use Min Kz option in edyintb [Y], otherwise revert to Kz0UT setenv CTM_ILDEPV Y # calculate in-line deposition velocities [Y] setenv CTM_MOSAIC N # landuse specific deposition velocities [N] setenv CTM_ABFLUX N # Ammonia bi-directional flux for in-line deposition velocities [N] ignore if CTM_ILDEPV = N setenv CTM_HGBIDI N # Mercury bi-directional flux for in-line deposition velocities [N] ignore if CTM_ILDEPV = N setenv CTM_SFC_HONO Y # Surface HONO interaction [Y] ignore if CTM_ILDEPV = N setenv CTM_PING N # run with Advanced Plume Treatment plume-in-grid [N] setenv CTM_PT3DEMIS Y # calculate in-line plume rise for elevated point emissions [N] setenv CTM_FST N # Mosaic method to get land-use specific stomatal flux [N] setenv CTM_BIOGEMIS Y # use in-line biogenic emissions [N] setenv PX_VERSION Y # MCIP is PX version? [Y] ignore if CTM_BIOGEMIS = N setenv BIOSW_YN N # Using a frost date switch file [Y] ignore if CTM_BIOGEMIS = N [Y] For SPRING and FALL setenv SUMMER_YN Y # Use summer normalized emissions? [Y] ignore if CTM_BIOGEMIS = N [Y] for SUMMER setenv AVG_FILE_ENDTIME N # override default beginning average file timestamp [N] setenv CTM_GRAV_SETL Y # J-,K-mode aerosols gravitational settling [Y] setenv CORESHELL_OPTICS N # Use core-shell mixing model for aerosol optical properties [N] setenv MIE_OPTICS N # Use Mie theory for aerosol optical properties of Internal mixing model [N] setenv LTNGPARAM Y # Use parameter file [N] setenv LTNG_ASSIM_FLAG N # Lightning assimilation on/off switch [N] setenv CTM_ZERO_PCSOA N # turn off the emissions of the VOC precursor to pcSOA [N] # I/O Controls setenv IOAPI_LOG_WRITE F # turn off excess WRITE3 logging [T] setenv FL_ERR_STOP F # stop on inconsistent input file [T] setenv IOAPI_OFFSET_64 Y # support large timestep records (>2GB/timestep record) [Y|N] setenv CTM_EMISCHK N # Abort CMAQ if missing surrogates from emissions Input files [Y] setenv PROMPTFLAG F # turn off I/O-API PROMPT*FILE interactive mode # diagnostic flags #setenv APMDIAG_BLEV_ELEV " 1 3" # layer range for integral average APMDIAG, default is all layers setenv CLD_DIAG N # cloud diagnostic file [N] setenv CTM_PMDIAG N # aerosol diagnostic file [Y] setenv CTM_APMDIAG Y # average aerosol diagnostic file [N] setenv CTM_AVISDIAG Y # average visibility diagnostic file [N] setenv CTM_PHOTDIAG N # photolysis rate diagnostic [N] setenv CTM_SSEMDIAG N # sea-salt emissions diagnostic file [N] setenv CTM_DUSTEM_DIAG N # windblown dust emissions diagnostic file [N] ignored if CTM_WB_DUST is N setenv CTM_DEPV_FILE N # diagnostic file for deposition velocities [N] setenv B3GTS_DIAG N # biogenic mass emissions diagnostic file [N] ignore if CTM_BIOGEMIS = N setenv APT_DIAG N # write APT diagnostic file [N] setenv PT3DDIAG N # optional 3d point source emissions diagnostic file [N] ignore if CTM_PT3DEMIS = N setenv PT3DFRAC N # optional layer fractions diagnostic (play) file(s) [N] ignore if CTM_PT3DEMIS = N setenv LTNGDIAG N # lightning diagnostic file [N] setenv VDIFF_DIAG_FILE N # VDIFF diagnostic files [N] setenv CTM_AOD N # IMPROVE network AOD diagnostic file [N] setenv CTM_MGEMDIAG N # writing marine gas emission diagnostic file [N] setenv REP_LAYER_MIN -1 # Minimum layer for reporting plume rise info [-1] # MPI tune up setenv MPI_SM_POOL 16000 # increase shared memory pool in case many MPI_SEND headers setenv MP_EAGER_LIMIT 65536 # set MPI message passing buffer to max setenv MP_SINGLE_THREAD yes # tell mpi threading is not done setenv MP_STDOUTMODE ordered # order stnd out msgs setenv MP_LABELIO yes setenv MP_SHARED_MEMORY yes # avoid using interconnect switch if on same node setenv MP_ADAPTER_USE shared # additional tuning setenv MP_CPU_USE multiple # additional tuning setenv MP_CSS_INTERRUPT yes # additional tuning # other files set OCEANfile = ocean_file.dummy.CONUS4K_d02.ncf #ocean_file_CONUS4K_d02_surfzone.final.ncf #CHANGE #size should be cmaq (row/col -1) set OMIfile = OMI_1979_to_2015.dat set OPTICSfile = PHOT_OPTICS.dat set CSQYfile = CSQY_DATA_$MECH set BCFILE = bc.CONUS4K.20160622.ncf #CHANGE set ICFILE = ic.CONUS4K.20160622.ncf #CHANGE # ##### end user define area ##### setenv RUNID v${version} # Input Directories and Filenames set ICpath = $INPDIR/icbc/CONUS4K/CONUS4K_d02/iconbcon/ set BCpath = $INPDIR/icbc/CONUS4K/CONUS4K_d02/iconbcon/ #set ICpath = $INPDIR/icbc/Chicago_LADCO/mozart # initial conditions input directory #set BCpath = $INPDIR/icbc/Chicago_LADCO/mozart # boundary conditions input directory set EMISpath = $INPDIR/emis/CONUS4K/CONUS4K_d02_201607 # surface emissions input directory set IN_PTpath = $INPDIR/emis/CONUS4K/CONUS4K_d02_201607 # elevated emissions input directory (in-line point only) set IN_LTpath = $INPDIR/land/CONUS4K_d02 # lighcd ..tning NOx input directorys set METpath = $INPDIR/met_wrf/CONUS4K/CONUS4K_d02_2016_07/ # wrf input directory / output from real.exe #CHECK set LUpath = /projects/b1045/wrf-cmaq/output/CONUS4K/wrf_pure_201607/mcip/d02_v2/ #$INPDIR/land/CONUS4K_d02 # BELD landuse data for windblown dust model set SZpath = $INPDIR/land/CONUS4K_d02 # surf zone file for in-line seasalt emissions if (($DO_SW_CAL == T) || ($DO_LW_CAL == T)) then setenv CMAQ_WRF_FEEDBACK T # [F] else setenv CMAQ_WRF_FEEDBACK F # [F] endif set rad_scheme = _rrtmg_$radt if ($CMAQ_WRF_FEEDBACK == 'T') then if ($DO_LW_CAL == T) then set feedback = slf else set feedback = sf endif else set feedback = nf endif set call_ratio = "${WRF_CMAQ_FREQ}_1" set output_direct_name = output_${EXPNAME}_${resolution}_${feedback}${rad_scheme}_${call_ratio}_v${version} # ----- CMAQ ----- set EXEC = CCTM set year = $start_year @ pre_year = $year - 1 @ cur_year = $year @ yr = $year @ start_hour = $cycle / 10000 @ end_hour = ($start_hour + 23) % 24 # loop through simulation period @ cur_year = $cur_year - 1 while ($cur_year < $end_year) @ cur_year++ if (($cur_year % 4) != 0) then set leap_year_cur_year = 0 else if (($cur_year % 400) == 0) then set leap_year_cur_year = 1 # leap year, nday = 29 else if (($cur_year % 100) == 0) then set leap_year_cur_year = 0 else set leap_year_cur_year = 1 # leap year, nday = 29 endif if ($leap_year_cur_year) then set numday_cur_year = ( 31 29 31 30 31 30 31 31 30 31 30 31 ) set leap_year_pre_year = 0 else set numday_cur_year = ( 31 28 31 30 31 30 31 31 30 31 30 31 ) if (($pre_year % 4) != 0) then set leap_year_pre_year = 0 else if (($pre_year % 400) == 0) then set leap_year_pre_year = 1 else if (($pre_year % 100) == 0) then set leap_year_pre_year = 0 else set leap_year_pre_year = 1 endif endif # setup the current and previous day in julian format if ($cur_year == $start_year) then @ cur_day_j = 0 @ temp_month = 1 while ($temp_month < $start_month) @ cur_day_j = $cur_day_j + $numday_cur_year[$temp_month] @ temp_month++ end @ cur_day_j = $cur_day_j + $start_day @ pre_day_j = $cur_day_j - 1 else @ cur_day_j = 1 endif if ($cur_day_j == 1) then if ($leap_year_pre_year) then set pre_day_j = 366 else set pre_day_j = 365 endif endif if ($cur_year == $start_year) then @ cur_month = $start_month else @ cur_month = 1 endif if ($cur_year == $end_year) then @ cur_end_month = $end_month else @ cur_end_month = 12 endif @ cur_month = $cur_month - 1 while ($cur_month < $cur_end_month) @ cur_month++ @ cur_day = 0 @ cur_month_end_day = $numday_cur_year[$cur_month] if (($cur_year == $start_year) && ($cur_month == $start_month)) then @ cur_day = $start_day - 1 endif if (($cur_year == $end_year) && ($cur_month == $cur_end_month)) then @ cur_month_end_day = $end_day endif while ($cur_day < $cur_month_end_day) @ cur_day++ set loc_pre_year = $cur_year if ($cur_day == 1) then @ pre_month = $cur_month - 1 if ($pre_month == 0) then set pre_month = 12 @ loc_pre_year = $cur_year - 1 endif set yest = $numday_cur_year[$pre_month] set yesterday = `printf "%d%2.2d%2.2d\n" $loc_pre_year $pre_month $yest` else @ yest = $cur_day - 1 set yesterday = `printf "%d%2.2d%2.2d\n" $loc_pre_year $cur_month $yest` endif set today = `printf "%d%2.2d%2.2d\n" $cur_year $cur_month $cur_day` # beginning date, yyyymmdd set YYYYMMDD = $today set YYYYMMDD_2 = `date -ud "${YYYYMMDD}" +%Y-%m-%d` set YYYYMM = `date -ud "${YYYYMMDD}" +%Y%m` set G_DAY = $today set today_j = `printf "%d%3.3d\n" $cur_year $cur_day_j` # beginning Julian date, yyyyxxx set yesterday_j = `printf "%d%3.3d\n" $loc_pre_year $pre_day_j` set wrf_tstep = 6 # change ? ribx error setenv CTM_APPL ${RUNID}_${YYYYMMDD} # set output file name extensions setenv CTM_APPL_yesterday ${RUNID}_${yesterday} # set output file name extensions for yesterday if ( ! -d $OUTPUT_ROOT/$output_direct_name ) then mkdir $OUTPUT_ROOT/$output_direct_name if ( $status != 0 ) then echo "Failed to make work directory, $OUTPUT_ROOT/$output_direct_name" exit 1 endif endif set use_profile_init = 0 if ($today == $firstday) then setenv WRF_RSTFLAG .false. if ($cont_from_spinup_run == T) then setenv FEEDBACK_RSTFLAG .false. # indicates whether feedback information is available in the wrfrst file set cont_from_spinup_run = F else setenv FEEDBACK_RSTFLAG .true. endif setenv pxlsm_smois_init 1 set use_profile_init = 1 else if ($cont_from_spinup_run == T) then setenv FEEDBACK_RSTFLAG .false. set cont_from_spinup_run = F set use_profile_init = 1 else setenv FEEDBACK_RSTFLAG .true. endif setenv WRF_RSTFLAG .true. setenv pxlsm_smois_init 0 endif setenv FEEDBACK_RSTFLAG .false. mkdir $OUTPUT_ROOT/$output_direct_name/$today set STDATE = $today_j # beginning date in julian format set APPL = $today #> horizontal grid defn setenv GRIDDESC $OUTPUT_ROOT/$output_direct_name/GRIDDESC setenv GRID_NAME CONUS4K_d02 #Change #> remove existing output files? set DISP = delete # set DISP = update # set DISP = keep set OUTDIR = $OUTPUT_ROOT/$output_direct_name # output files and directories # this is for inline biogenic emissions *.q set YEAR = $year set MONTH = `printf "%2.2d\n" $cur_month` set day = $cur_day set EMISDATE = `printf "%4d%2.2d%2.2d\n" ${YEAR} $cur_month $cur_day` # ICBC file if ($use_profile_init) then setenv INITIAL_RUN Y #related to restart soil information file else set ICpath = $OUTDIR set ICFILE = CCTM_CGRID_${CTM_APPL_yesterday}.nc setenv INITIAL_RUN N endif set test = `ls CTM_LOG_???.${APPL}` if ( "$test" != "" ) then if ( $DISP == 'delete' ) then echo " ancillary log files being deleted" foreach file ( $test ) echo " deleting $file" rm $file end else echo "*** Logs exist - run ABORTED ***" exit 1 endif endif # Lightning NOx configuration if ( $CTM_LTNG_NO == 'Y' ) then setenv LTNGNO "InLine" #> set LTNGNO to "Inline" to activate in-line calculation # In-line lightning NOx options setenv USE_NLDN N # use hourly NLDN strike file [ default: Y /] setenv LTNGPARAM Y # use lightning parameter file [ default: Y ] if ( $USE_NLDN == Y ) then setenv NLDN_STRIKES $INPDIR/lightning/NLDN.12US1.${YYYYMMDD}_bench.nc else setenv LOG_START 2.0 # RC value to transit linear to log linear endif # lightning parameter file; ignore if LTNGPARAM = N setenv LTNGPARMS_FILE $IN_LTpath/LTNG_AllParms_CONUS4K_windowed_from_12US1.ncf # jls endif #> In-line biogenic emissions configuration if ( $CTM_BIOGEMIS == 'Y' ) then set IN_BEISpath = ${INPDIR}/land/CONUS4K_d02 #change set GSPROpath = ${IN_BEISpath} setenv GSPRO $GSPROpath/gspro_beis_cmaq_cb6_2016ff_16j_nf.txt # jls setenv B3GRD $IN_BEISpath/b3grd_2016ff_16j_windowed_from_12US1.CONUS4K_d02.nc # jls setenv BIOG_SPRO B10C6 # speciation profile to use for biogenics setenv BIOSW_YN N # use frost date switch [ default: Y ] setenv BIOSEASON $IN_BEISpath/bioseason.cmaq.2018j_12US1.CONUS4K_d02.nc #> ignore season switch file if BIOSW_YN = N setenv SUMMER_YN N # Use summer normalized emissions? [ default: Y ] setenv PX_VERSION Y # MCIP is PX version? [ default: N ] setenv INITIAL_RUN Y # non-existent or not using SOILINP [ default: N ]; default uses SOILINP setenv SOILINP $OUTDIR/CCTM_SOILOUT_${RUNID}_${yesterday}.nc # Biogenic NO soil input file; ignore if INITIAL_RUN = Y endif # Windblown dust emissions configuration if ( $CTM_WB_DUST == 'Y' ) then # Input variables for BELD3 Landuse option setenv DUST_LU_1 $LUpath/GRIDCRO2D_CONUS4K_d02_${YYYYMMDD_2}.nc #change setenv DUST_LU_2 $LUpath/GRIDCRO2D_CONUS4K_d02_${YYYYMMDD_2}.nc #change setenv MODIS_FPAR $INPDIR/land/CONUS4K_d02/LAI_OUT_daily_d02_ioapi.nc #change # Input variables for BELD4 Landuse option setenv BELD4_LU $INPDIR/land/CONUS4K_d02/beld41_feb2017_waterfix_windowed_from_12US1.CONUS4K_d02.nc #change #setenv BELD4_LU $LUpath/beld4_12US1_459X299_output_tot_bench.nc # All other Landuse options (USGS24, MODIS_NOAH, MODIS, NLCD50, NLCD40) read the GRID_CRO_2D file if ( $CTM_ERODE_AGLAND == 'Y' ) then setenv CROPMAP01 ${INPDIR}/land/BeginPlanting_12km_bench.nc setenv CROPMAP04 ${INPDIR}/land/EndPlanting_12km_bench.nc setenv CROPMAP08 ${INPDIR}/land/EndHarvesting_12km_bench.nc endif endif # Bidiretional ammonia configuration if ( $CTM_ABFLUX == 'Y' ) then setenv E2C_Soilfile ${INPDIR}/land/2011_US1_soil_bench.nc setenv E2C_Fertfile ${INPDIR}/land/2011_US1_time${YYYYMMDD}_bench.nc setenv B4LU_file ${INPDIR}/land/beld4_12kmCONUS_2006nlcd_bench.nc setenv E2C_SOIL ${E2C_Soilfile} setenv E2C_FERT ${E2C_Fertfile} setenv BELD4_LU ${B4LU_file} endif setenv CSQY_DATA $NMLpath/$CSQYfile if (! (-e $CSQY_DATA ) ) then echo " $CSQY_DATA not found " exit 1 endif setenv OCEAN_1 $SZpath/$OCEANfile # Emissions files setenv EMISfile emis_mole_all_${YYYYMMDD}_CONUS4K_d02_nobeis_2016ff_16j.ncf #change setenv EMIS_1 $EMISpath/$EMISfile if ( $CTM_PT3DEMIS == 'Y' || $CTM_PT3DEMIS == 'T' ) then setenv NPTGRPS 7 #change -- for all ppoints #set iday = `grep ^$STDATE $INPDIR/mergedates.2018.txt` setenv grpIX 5 setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` #echo "TESTING TESTING TESTING" #echo $iday #echo "TESTING TESTING TESTING" setenv STK_GRPS_01 $IN_PTpath/stack_groups_ptnonipm_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_01 $IN_PTpath/inln_mole_ptnonipm_${iday}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change echo $STK_EMIS_01 setenv grpIX 4 setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` echo $iday setenv STK_GRPS_02 $IN_PTpath/stack_groups_othpt_CONUS4K_d02_2016ff_16j.ncf setenv STK_EMIS_02 $IN_PTpath/inln_mole_othpt_${iday}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf setenv grpIX 8 setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_02 $IN_PTpath/stack_groups_ptegu_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_02 $IN_PTpath/inln_mole_ptegu_${iday}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change setenv grpIX 5 setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_03 $IN_PTpath/stack_groups_pt_oilgas_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_03 $IN_PTpath/inln_mole_pt_oilgas_${iday}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change setenv grpIX 2 setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_04 $IN_PTpath/stack_groups_cmv_c3_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_04 $IN_PTpath/inln_mole_cmv_c3_${iday}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change setenv grpIX 1 # doesn't matter for this one setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_05 $IN_PTpath/stack_groups_ptagfire_${YYYYMMDD}_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_05 $IN_PTpath/inln_mole_ptagfire_${YYYYMMDD}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #changeTE setenv grpIX 3 # doesnt matter for this one setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_06 $IN_PTpath/stack_groups_ptfire_${YYYYMMDD}_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_06 $IN_PTpath/inln_mole_ptfire_${YYYYMMDD}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change setenv grpIX 6 # doesnt matter for this one setenv iday `grep x${YYYYMMDD} ${EMISpath}/mergedates/smk_merge_dates_${YYYYMM}.txt | cut -d ',' -f$grpIX` setenv STK_GRPS_07 $IN_PTpath/stack_groups_ptfire_othna_${YYYYMMDD}_CONUS4K_d02_2016ff_16j.ncf #change setenv STK_EMIS_07 $IN_PTpath/inln_mole_ptfire_othna_${YYYYMMDD}_CONUS4K_d02_cmaq_cb6_2016ff_16j.ncf #change unset echo if ( $REP_LAYER_MIN != "0" ) then set DATE = $EMISDATE @ count = 0 while ( $count <= $NPROCS ) if ( $count <= 9 ) then set sub = 0${count} else set sub = ${count} endif @ grp = 1 while ( $grp <= $NPTGRPS ) set file = $OUTDIR/rptlay_0${grp}.${DATE}.${APPL}_${sub} setenv REPRTLAY_0${grp}${sub} $file if ( $DISP == 'delete' ) /bin/rm -f $file @ grp ++ end @ count ++ end endif set echo setenv LAYP_STDATE $STDATE setenv LAYP_STTIME $STTIME setenv LAYP_NSTEPS $NSTEPS endif # Output Files setenv S_CGRID "$OUTDIR/CCTM_CGRID_${CTM_APPL}.nc" #> 3D Inst. Concenctrations setenv CTM_CONC_1 "$OUTDIR/CCTM_CONC_${CTM_APPL}.nc -v" #> On-Hour Concentrations setenv A_CONC_1 "$OUTDIR/CCTM_ACONC_${CTM_APPL}.nc -v" #> Hourly Avg. Concentrations setenv MEDIA_CONC "$OUTDIR/CCTM_MEDIA_CONC_${CTM_APPL}.nc -v" #> NH3 Conc. in Media setenv CTM_DRY_DEP_1 "$OUTDIR/CCTM_DRYDEP_${CTM_APPL}.nc -v" #> Hourly Dry Deposition setenv CTM_DEPV_DIAG "$OUTDIR/CCTM_DEPV_${CTM_APPL}.nc -v" #> Dry Deposition Velocities setenv CTM_PT3D_DIAG "$OUTDIR/CCTM_PT3D_${CTM_APPL}.nc -v" #> setenv B3GTS_S "$OUTDIR/CCTM_B3GTS_S_${CTM_APPL}.nc -v" #> Biogenic Emissions setenv SOILOUT "$OUTDIR/CCTM_SOILOUT_${CTM_APPL}.nc" #> Soil Emissions setenv CTM_WET_DEP_1 "$OUTDIR/CCTM_WETDEP1_${CTM_APPL}.nc -v" #> Wet Dep From All Clouds setenv CTM_WET_DEP_2 "$OUTDIR/CCTM_WETDEP2_${CTM_APPL}.nc -v" #> Wet Dep From SubGrid Clouds setenv CTM_VIS_1 "$OUTDIR/CCTM_PMVIS_${CTM_APPL}.nc -v" #> On-Hour Visibility setenv CTM_AVIS_1 "$OUTDIR/CCTM_APMVIS_${CTM_APPL}.nc -v" #> Hourly-Averaged Visibility setenv CTM_PMDIAG_1 "$OUTDIR/CCTM_PMDIAG_${CTM_APPL}.nc -v" #> On-Hour Particle Diagnostics setenv CTM_APMDIAG_1 "$OUTDIR/CCTM_APMDIAG_${CTM_APPL}.nc -v" #> Hourly Avg. Particle Diagnostic setenv CTM_RJ_1 "$OUTDIR/CCTM_PHOTDIAG1_${CTM_APPL}.nc -v" #> Photolysis Rxn Diagnostics setenv CTM_RJ_2 "$OUTDIR/CCTM_PHOTDIAG2_${CTM_APPL}.nc -v" #> Photolysis Rates Output setenv CTM_SSEMIS_1 "$OUTDIR/CCTM_SSEMIS.${CTM_APPL}.nc -v" #> Sea Spray Emissions setenv CTM_DUST_EMIS_1 "$OUTDIR/CCTM_DUSTEMIS.${CTM_APPL}.nc -v" #> Dust Emissions setenv CTM_IPR_1 "$OUTDIR/CCTM_PA_1_${CTM_APPL}.nc -v" #> Process Analysis setenv CTM_IPR_2 "$OUTDIR/CCTM_PA_2_${CTM_APPL}.nc -v" #> Process Analysis setenv CTM_IPR_3 "$OUTDIR/CCTM_PA_3_${CTM_APPL}.nc -v" #> Process Analysis setenv CTM_IRR_1 "$OUTDIR/CCTM_IRR_1_${CTM_APPL}.nc -v" #> Chem Process Analysis setenv CTM_IRR_2 "$OUTDIR/CCTM_IRR_2_${CTM_APPL}.nc -v" #> Chem Process Analysis setenv CTM_IRR_3 "$OUTDIR/CCTM_IRR_3_${CTM_APPL}.nc -v" #> Chem Process Analysis setenv CTM_DRY_DEP_MOS "$OUTDIR/CCTM_DDMOS_${CTM_APPL}.nc -v" #> Dry Dep setenv CTM_DRY_DEP_FST "$OUTDIR/CCTM_DDFST_${CTM_APPL}.nc -v" #> Dry Dep setenv CTM_DEPV_MOS "$OUTDIR/CCTM_DEPVFST_${CTM_APPL}.nc -v" #> Dry Dep Velocity setenv CTM_DEPV_FST "$OUTDIR/CCTM_DEPVMOS_${CTM_APPL}.nc -v" #> Dry Dep Velocity setenv CTM_VDIFF_DIAG "$OUTDIR/CCTM_VDIFF_DIAG_${CTM_APPL}.nc -v" #> Vertical Dispersion Diagnostic setenv CTM_VSED_DIAG "$OUTDIR/CCTM_VSED_DIAG_${CTM_APPL}.nc -v" #> Particle Grav. Settling Velocity setenv CTM_AOD_1 "$OUTDIR/CCTM_AOD_DIAG_${CTM_APPL}.nc -v" #> Aerosol Optical Depth Diagnostic setenv CTM_LTNGDIAG_1 "$OUTDIR/CCTM_LTNGHRLY_${CTM_APPL}.nc -v" #> Hourly Avg Lightning NO setenv CTM_LTNGDIAG_2 "$OUTDIR/CCTM_LTNGCOL_${CTM_APPL}.nc -v" #> Column Total Lightning NO # set floor file (neg concs) setenv FLOOR_FILE ${OUTDIR}/FLOOR_${CTM_APPL}.txt setenv LAYER_FILE MET_CRO_3D # setup BUFFER file setenv GRID_DOT_2D BUFFERED setenv GRID_CRO_2D BUFFERED setenv MET_CRO_2D BUFFERED setenv MET_DOT_3D BUFFERED setenv MET_CRO_3D BUFFERED @ n = 0 while ($n < $NPROCS) set name = `printf "_%3.3d\n" $n` setenv feed_back$name BUFFERED # for feedback file @ n++ end # this is for creating physical files setenv PGRID_DOT_2D "$OUTDIR/GRID_DOT_2D$today -v" setenv PGRID_CRO_2D "$OUTDIR/GRID_CRO_2D$today -v" setenv PMET_CRO_2D "$OUTDIR/MET_CRO_2D$today -v" setenv PMET_DOT_3D "$OUTDIR/MET_DOT_2D$today -v" setenv PMET_CRO_3D "$OUTDIR/MET_CRO_3D$today -v" if ($SD_TIME_SERIES == T) then setenv CTM_SD_TS "$OUTDIR/SD_TSfile$today -v" endif #> for the run control ... setenv CTM_STDATE $STDATE setenv CTM_STTIME $STTIME setenv CTM_RUNLEN $NSTEPS setenv CTM_TSTEP $TSTEP setenv CTM_PROGNAME $EXEC setenv INIT_GASC_1 $ICpath/$ICFILE setenv INIT_AERO_1 $INIT_GASC_1 setenv INIT_NONR_1 $INIT_GASC_1 setenv INIT_TRAC_1 $INIT_GASC_1 setenv BNDY_GASC_1 $BCpath/$BCFILE setenv BNDY_AERO_1 $BNDY_GASC_1 setenv BNDY_NONR_1 $BNDY_GASC_1 setenv BNDY_TRAC_1 $BNDY_GASC_1 setenv OMI $OMIpath/$OMIfile setenv OPTICS_DATA $OMIpath/$OPTICSfile # ----- END CMAQ ----- cd $OUTPUT_ROOT/$output_direct_name #> mechanism name list files ln -s $NMLpath/GC_$MECH.nml gc_matrix_nml ln -s $NMLpath/AE_$MECH.nml ae_matrix_nml ln -s $NMLpath/NR_$MECH.nml nr_matrix_nml ln -s $NMLpath2/Species_Table_TR_0.nml tr_matrix_nml #----------------------------------------------------------------------- # Build WRF namelist. # https://esrl.noaa.gov/gsd/wrfportal/namelist_input_options.html #----------------------------------------------------------------------- if ( -f namelist.input ) rm -f namelist.input cat << End_Of_Namelist > namelist.input &time_control run_days = 1, RUN_HOURS = 0, run_minutes = 0, run_seconds = 0, START_YEAR = $year, START_MONTH = $cur_month, START_DAY = $start_day, START_HOUR = $start_hour start_minute = 00, start_second = 00, END_YEAR = $year END_MONTH = $cur_month END_DAY = $end_day END_HOUR = $end_hour end_minute = 00, end_second = 00, interval_seconds = 10800 input_from_file = .true., HISTORY_INTERVAL = 60 FRAMES_PER_OUTFILE = 24 !changed restart = .false. restart_interval = 1440, io_form_restart = 2 io_form_input = 2 io_form_boundary = 2 io_form_auxinput2 = 2 debug_level = 300 write_hist_at_0h_rst = .true. auxinput4_inname = "wrflowinp_d02", auxinput4_interval = 10800, io_form_auxinput4 = 2 io_form_auxinput2 = 2 !changed / &domains time_step = $wrf_tstep, time_step_fract_num = 0, time_step_fract_den = 1, max_dom = 1, s_we = 1, e_we = $WRF_COL_DIM, s_sn = 1, e_sn = $WRF_ROW_DIM, s_vert = 1, e_vert = $WRF_LAY_DIM, eta_levels = 1.0, 0.9975, 0.995, 0.99, 0.985, 0.98, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.91, 0.9, 0.88, 0.86, 0.84, 0.82, 0.8, 0.77, 0.74, 0.7, 0.65, 0.6, 0.55, 0.5, 0.45, 0.4, 0.35, 0.3, 0.25, 0.2, 0.15, 0.1, 0.05, 0.0 p_top_requested = 10000, num_metgrid_levels = 30 dx = 4000, dy = 4000, grid_id = 1, parent_id = 0, i_parent_start = 0, j_parent_start = 0, parent_grid_ratio = 1, parent_time_step_ratio = 1, feedback = 1, smooth_option = 0 / &physics mp_physics = 10, mp_zero_out = 2, ra_lw_physics = 4, ra_sw_physics = 4, paerlev = 29, levsiz = 59, cam_abs_dim1 = 4, cam_abs_dim2 = $WRF_LAY_DIM, radt = $radt, sf_sfclay_physics = 7, sf_surface_physics = 7, bl_pbl_physics = 7, bldt = 0, cu_physics = 1, cudt = 0, cugd_avedx = 3, !change kfeta_trigger = 2, isfflx = 1, ifsnow = 1, icloud = 1, surface_input_source = 1, num_soil_layers = 2, num_soil_cat = 4, sst_update = 1, pxlsm_smois_init = $pxlsm_smois_init, slope_rad = 1, topo_shading = 1, shadlen = 25000., num_land_cat = $NUM_LAND_USE_TYPE, sf_urban_physics = 0, !added usemonalb = .true., !added prec_acc_dt = 60, !added / &fdda grid_fdda = 1, !change grid_sfdda = 1, !change pxlsm_soil_nudge = 1, sgfdda_inname = "wrfsfdda_d02", !change sgfdda_end_h = 10000, !?changed sgfdda_interval_m = 180, gfdda_inname = "wrffdda_d02", !change GFDDA_END_H = 10000, !?changed gfdda_interval_m = 180, fgdt = 0, if_no_pbl_nudging_uv = 1, if_no_pbl_nudging_t = 1, if_no_pbl_nudging_q = 1, if_zfac_uv = 0, k_zfac_uv = 13, if_zfac_t = 0, k_zfac_t = 13, if_zfac_q = 0, k_zfac_q = 13, guv = 0.0001, !changed gt = 0.0001, !changed gq = 0.00001, guv_sfc = 0.0000, gt_sfc = 0.0000, gq_sfc = 0.0000, if_ramping = 0, dtramp_min = 60.0, io_form_gfdda = 2, rinblw = 250.0, / &dynamics rk_ord = 3, w_damping = 1, diff_opt = 1, km_opt = 4, diff_6th_opt = 2, diff_6th_factor = 0.12, damp_opt = 3, base_temp = 290., zdamp = 5000., dampcoef = 0.05, !change khdif = 0, kvdif = 0, non_hydrostatic = .true., moist_adv_opt = 2, tke_adv_opt = 2, scalar_adv_opt = 2, / &bdy_control spec_bdy_width = 1, spec_zone = 1, relax_zone = 0, specified = .true., nested = .false., / &grib2 / &namelist_quilt nio_tasks_per_group = 0, nio_groups = 1, / End_Of_Namelist # what is this section # change setenv WRF_RSTFLAG .false. rm -f wrfbdy_d01 wrffdda_d02 wrfsfdda_d02 wrfinput_d01 wrflowinp_d02 ln -s $METpath/wrfbdy_d01 wrfbdy_d01 ln -s $METpath/wrffdda_d02 wrffdda_d02 ln -s $METpath/wrfsfdda_d02 wrfsfdda_d02 if (${WRF_RSTFLAG} == .false.) then ln -s $METpath/wrfinput_d02 wrfinput_d01 else ln -s $METpath/wrfrst_d01* . endif ln -s $METpath/wrflowinp_d02 wrflowinp_d02 #----------------------------------------------------------------------- # Set up and run WRF-EM executable. #----------------------------------------------------------------------- if ( -f wrf.exe ) rm -f wrf.exe if ( -f ETAMPNEW_DATA ) rm -f ETAMPNEW_DATA if ( -f GENPARM.TBL ) rm -f GENPARM.TBL if ( -f landFilenames ) rm -f landFilenames if ( -f LANDUSE.TBL ) rm -f LANDUSE.TBL if ( -f RRTM_DATA ) rm -f RRTM_DATA if ( -f SOILPARM.TBL ) rm -f SOILPARM.TBL if ( -f tr49t67 ) rm -f tr49t67 if ( -f tr49t85 ) rm -f tr49t85 if ( -f tr67t85 ) rm -f tr67t85 if ( -f VEGPARM.TBL ) rm -f VEGPARM.TBL ln -s $WRF_DIR/main/wrf.exe wrf.exe ln -s $WRF_DIR/test/em_real/ETAMPNEW_DATA ETAMPNEW_DATA ln -s $WRF_DIR/test/em_real/GENPARM.TBL GENPARM.TBL ln -s $WRF_DIR/test/em_real/landFilenames landFilenames ln -s $WRF_DIR/test/em_real/LANDUSE.TBL LANDUSE.TBL ln -s $WRF_DIR/test/em_real/RRTM_DATA RRTM_DATA ln -s $WRF_DIR/test/em_real/RRTMG_SW_DATA RRTMG_SW_DATA ln -s $WRF_DIR/test/em_real/RRTMG_LW_DATA RRTMG_LW_DATA ln -s $WRF_DIR/test/em_real/SOILPARM.TBL SOILPARM.TBL ln -s $WRF_DIR/test/em_real/tr49t67 tr49t67 ln -s $WRF_DIR/test/em_real/tr49t85 tr49t85 ln -s $WRF_DIR/test/em_real/tr67t85 tr67t85 ln -s $WRF_DIR/test/em_real/VEGPARM.TBL VEGPARM.TBL ln -s $WRF_DIR/test/em_real/ozone_plev.formatted ozone_plev.formatted ln -s $WRF_DIR/test/em_real/ozone_lat.formatted ozone_lat.formatted ln -s $WRF_DIR/test/em_real/ozone.formatted ozone.formatted date '+Started wrf.exe at %m/%d/%y %H:%M:%S' # time mpirun -r ssh -np $NPROCS wrf.exe time mpirun -verbose -np $NPROCS ./wrf.exe # time mpirun -genv OMP_NUM_THREADS $OMP_NUM_THREADS -np $NPROCS ./wrf.exe date '+Completed WRF at %m/%d/%y %H:%M:%S%n' mv rsl.* $OUTPUT_ROOT/$output_direct_name/$today if ($CREATE_PHYSICAL_FILE == T) then mv MET* $OUTPUT_ROOT/$output_direct_name/$today mv GRI* $OUTPUT_ROOT/$output_direct_name/$today endif if ( $CTM_BIOGEMIS == 'Y' ) then mv $SOILOUT $OUTDIR/$EXEC"_SOILINP".${APPL} setenv SOILINP $OUTDIR/$EXEC"_SOILINP".${APPL} # Biogenic NO soil input file setenv INITIAL_RUN N endif @ cur_day_j++ @ pre_day_j++ if ($pre_day_j > $cur_day_j) then @ pre_day_j = $cur_day_j - 1 endif end # end of date loop end # end of month loop @ pre_year++ end # end of year loop