#!/bin/csh #SBATCH -J mpas52 #SBATCH -p compute #SBATCH -t 72:00:00 #SBATCH -n 128 #SBATCH -o /work/MOD3DEV/wdx/ptmp/sandbox/MPASv5.1.EPA-modified/run-gfs/run_mpass.log #SBATCH -e /work/MOD3DEV/wdx/ptmp/sandbox/MPASv5.1.EPA-modified/run-gfs/run_mpass.log limit stacksize unlimited set echo #################################################################### setenv cell_num 1001 setenv ncd_64bit_offset .true. setenv NPROCS 128 source ~/bin/mypur i15 set MPAS_path = /work/MOD3DEV/wdx/ptmp/sandbox/MPASv5.1.EPA-modified set MPAS_path_output = /work/MOD3DEV/wdx/ptmp/sandbox/MPASv5.1.EPA-modified/run-gfs set EMIS_path = /work/MOD3DEV/wdx/ptmp/sandbox/MPASv5.1.EPA-modified/emis_input set MPASEXE=${MPAS_path}/atmosphere_model cd ${MPAS_path_output} setenv mpas_cmaq_freq 3 setenv run_cmaq_driver T setenv CTM_PHOTDIAG N # CTM_RJ_1 and CTM_RJ_2 [N] setenv CTM_PMDIAG N # aerosol diagnostic file [N] setenv CTM_DEPV_FILE N # CTM_DEPV_DIAG file [N] setenv run_aero F setenv CTM_RUNLEN 240000 setenv CTM_TSTEP 10000 set mech_name = cb6r3_ae6_aq setenv gc_matrix_nml ${MPAS_path}/src/core_atmosphere/cmaq/GC_$mech_name.nml setenv ae_matrix_nml ${MPAS_path}/src/core_atmosphere/cmaq/AE_$mech_name.nml setenv nr_matrix_nml ${MPAS_path}/src/core_atmosphere/cmaq/NR_$mech_name.nml setenv tr_matrix_nml ${MPAS_path}/src/core_atmosphere/cmaq/Species_Table_TR_0.nml setenv CSQY_DATA ${MPAS_path}/src/core_atmosphere/cmaq/CSQY_DATA_$mech_name setenv OPTICS_DATA ${MPAS_path}/src/core_atmosphere/cmaq/PHOT_OPTICS.dat setenv LAND_SCHEME NLCD40 setenv OMI ${MPAS_path}/src/core_atmosphere/cmaq/omi_cmaq_2015_361X179.dat setenv FILE_INFO ${MPAS_path_output}/file_input.txt setenv mpas_dmap_file ${MPAS_path}/basic_input/x4.163842.graph.info.part.$NPROCS ln -s ${MPAS_path}/basic_input/x4.163842.graph.info.part.$NPROCS x4.163842.graph.info.part.$NPROCS rm log.* run_mpas.log #require input files ln -s ${MPAS_path}/basic_input/LANDUSE.TBL LANDUSE.TBL ln -s ${MPAS_path}/basic_input/VEGPARM.TBL VEGPARM.TBL ln -s ${MPAS_path}/basic_input/GENPARM.TBL GENPARM.TBL ln -s ${MPAS_path}/basic_input/OZONE_DAT.TBL OZONE_DAT.TBL ln -s ${MPAS_path}/basic_input/OZONE_LAT.TBL OZONE_LAT.TBL ln -s ${MPAS_path}/basic_input/OZONE_PLEV.TBL OZONE_PLEV.TBL ln -s ${MPAS_path}/basic_input/SOILPARM.TBL SOILPARM.TBL ln -s ${MPAS_path}/basic_input/RRTMG_LW_DATA RRTMG_LW_DATA ln -s ${MPAS_path}/basic_input/RRTMG_LW_DATA.DBL RRTMG_LW_DATA.DBL ln -s ${MPAS_path}/basic_input/RRTMG_SW_DATA RRTMG_SW_DATA ln -s ${MPAS_path}/basic_input/RRTMG_SW_DATA.DBL RRTMG_SW_DATA.DBL # Set Start and End Days for looping set start_year = 2015 set end_year = 2015 set start_month = 10 set end_month = 10 set start_day = 1 set end_day = 1 set cycle = 0 set firstday = 20151001 setenv STTIME $cycle # beginning GMT time (HHMMSS) setenv NSTEPS 240000 # time duration (HHMMSS) for this run setenv TSTEP 010000 # output time step interval (HHMMSS) 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 cur_month_02 = `printf "%2.2d\n" $cur_month ` set cur_day_02 = `printf "%2.2d\n" $cur_day ` setenv CTM_RJ_1 ${MPAS_path_output}/CTM_RJ_1_${today}.nc setenv CTM_RJ_2 ${MPAS_path_output}/CTM_RJ_2_${today}.nc setenv CTM_PMDIAG_1 ${MPAS_path_output}/CTM_PMDIAG_${today}.nc setenv CTM_DRY_DEP_1 ${MPAS_path_output}/CTM_DRYDEP_${today}.nc # setenv CTM_DEPV_DIAG ${MPAS_path_output}/CTM_DEPV_${today}.nc setenv EMIS_1 ${EMIS_path}/edgar_HTAP_emi_test.mpas.${today}.90-25.nc set emis_type_list = ( g_ag \ g_air_cds \ g_air_crs \ g_air_lto \ g_biog \ g_energy \ g_industry \ g_ptagfire \ g_ptfire \ g_residential \ g_ships \ g_transport \ ) ln -s ${MPAS_path}/basic_input/x4.163842.US_fdda.nc x4.163842.US_fdda.nc ln -s ${MPAS_path}/basic_input/x4.163842.US_sfc.nc x4.163842.US_sfc.nc ln -s ${MPAS_path}/basic_input/x4.163842.US_soilndg.nc x4.163842.US_soilndg.nc ln -s ${MPAS_path}/basic_input/x4.163842.US_init.nc x4.163842.US_init.nc ln -s ${MPAS_path}/basic_input/x4.163842.US_ozone.nc x4.163842.US_ozone.nc if ($today == $firstday) then set restart_flag = false setenv mpas_restart F else set restart_flag = true setenv mpas_restart T endif if ( -f namelist.atmosphere ) rm -f namelist.atmosphere # streams.atmosphere cat << End_Of_Namelist > namelist.atmosphere &nhyd_model config_dt = 150.0 config_start_time = '${cur_year}-${cur_month_02}-${cur_day_02}_00:00:00' config_run_duration = '00_24:00:00' config_split_dynamics_transport = true config_number_of_sub_steps = 2 config_dynamics_split_steps = 3 config_h_mom_eddy_visc2 = 0.0 config_h_mom_eddy_visc4 = 0.0 config_v_mom_eddy_visc2 = 0.0 config_h_theta_eddy_visc2 = 0.0 config_h_theta_eddy_visc4 = 0.0 config_v_theta_eddy_visc2 = 0.0 config_horiz_mixing = '2d_smagorinsky' config_len_disp = 25000.0 config_visc4_2dsmag = 0.05 config_w_adv_order = 3 config_theta_adv_order = 3 config_scalar_adv_order = 3 config_u_vadv_order = 3 config_w_vadv_order = 3 config_theta_vadv_order = 3 config_scalar_vadv_order = 3 config_scalar_advection = true config_positive_definite = false config_monotonic = true config_coef_3rd_order = 0.25 config_epssm = 0.1 config_smdiv = 0.1 config_h_ScaleWithMesh = true / &damping config_zd = 22000.0 config_xnutr = 0.2 / &io config_pio_num_iotasks = 0 config_pio_stride = 1 / &decomposition config_block_decomp_file_prefix = 'x4.163842.graph.info.part.' / &restart config_do_restart = $restart_flag / &printout config_print_global_minmax_vel = true config_print_detailed_minmax_vel = true config_print_global_minmax_sca = true / &IAU config_IAU_option = 'off' config_IAU_window_length_s = 21600. / &physics config_physics_suite = 'none' config_soilndg_update = true config_soilndg_interval = '03:00:00' config_px_soilndg = 1 config_px_smoisinit = 1 config_sst_update = true config_sstdiurn_update = false config_deepsoiltemp_update = false config_radtlw_interval = '00:15:00' config_radtsw_interval = '00:15:00' config_bucket_update = 'none' config_microp_scheme = 'mp_wsm6' config_convection_scheme = 'cu_kain_fritsch' config_kfeta_trigger = 1 config_cu_rad_feedback = true config_lsm_scheme = 'px' config_pbl_scheme = 'bl_acm' config_gwdo_scheme = 'off' config_radt_cld_scheme = 'cld_fraction' config_radt_lw_scheme = 'rrtmg_lw' config_radt_sw_scheme = 'rrtmg_sw' config_sfclayer_scheme = 'sf_pxsfclay' config_fdda_scheme = 'analysis' config_fdda_t = true config_fdda_t_in_pbl = false config_fdda_t_min_layer = 0 config_fdda_t_coef = 0.0003 config_fdda_q = true config_fdda_q_in_pbl = false config_fdda_q_min_layer = 0 config_fdda_q_coef = 0.00003 config_fdda_uv = true config_fdda_uv_in_pbl = false config_fdda_uv_min_layer = 0 config_fdda_uv_coef = 0.0003 num_soil_layers = 4 num_land_cat = 40 config_landuse_data = 'nlcd40' config_frac_seaice = false / &soundings config_sounding_interval = 'none' / End_Of_Namelist date '+Started MPAS atmosphere_model at %m/%d/%y %H:%M:%S' mpirun -np $NPROCS $MPASEXE date '+Completed MPAS atmosphere_model at %m/%d/%y %H:%M:%S%n' if (! -d ${today}) mkdir $today mv log.* MIO* $today @ 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