suite.rc 6.8 KB
Newer Older
1 2 3 4 5 6
#!jinja2
[cylc]
	UTC mode = True # Ignore DST
	abort if any task fails = False

[scheduling]
7
	initial cycle point = {{INITIAL_START_DATE}}
8
{% if FINAL_CYCLE_POINT != 'NONE' %}
9
        final cycle point = {{FINAL_CYCLE_POINT}}
10
{% endif %}
11 12 13 14 15 16 17 18 19 20 21 22 23
	[[special tasks]]
		clock-trigger = start_cycle(PT0M)
	[[dependencies]]
		[[[R1]]]
			graph = """
					copy_common_to_remote => softlink_forcing_remote
					write_run_namelist => hot_cold_start => run_fvcom
					"""
		[[[P1D]]]
			graph = """
					run_fvcom[-P1D] =>  start_cycle => softlink_forcing  & softlink_forcing_remote => write_run_namelist

{% if FORECAST and (WIND_ON == 'T' or HEATING_ON == 'T' or PRECIPITATION_ON == 'T' or AIR_PRESSURE_ON == 'T') %}
Mike Bedington's avatar
Mike Bedington committed
24
				start_cycle => wrf_suite_trigger <wrf::transfer_for_fvcom> => get_wrf_file => write_run_namelist
25 26 27 28 29
{% endif %}

{% if BOUNDARY_FORCING == 'TIDAL' %}
					start_cycle => generate_tide_forcing => write_run_namelist
{% elif BOUNDARY_FORCING == 'CMEMS' %}
30
					start_cycle => CMEMS_download_trigger <download::get_CMEMS_data:finish> => generate_CMEMS_nest => copy_CMEMS_nest_to_remote => write_run_namelist
31 32 33 34 35
{% elif BOUNDARY_FORCING == 'NEST_FILE' %}
					start_cycle => nest_suite_trigger<{{NEST_RUN_SUITE}}::transfer_data> => get_nest_file => write_run_namelist
{% endif %}

{% if RIVER_MODEL == 'NEURAL_NET' %}
Mike Bedington's avatar
Mike Bedington committed
36
					start_cycle => wrf_archive_trigger <wrf::cycle_finished> & update_river_model & softlink_forcing => generate_rivers 
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
					generate_rivers => mv_river_files => write_river_number
					write_run_namelist => write_river_number => run_fvcom
{% elif RIVER_MODEL == 'CLIMATOLOGY' %}
					start_cycle => get_river_files => write_run_namelist => write_river_number => run_fvcom
{% endif %}

{%- if SEDIMENT %}
					write_cstms_namelist => run_fvcom
{%- endif %}

					write_run_namelist => run_fvcom => transfer_data
					"""
		[[[+P1D/P1D]]]
			graph = """
					run_fvcom[-P1D] => transfer_restart => run_fvcom
					"""

[runtime]
	[[root]]
		env-script = eval $(rose task-env --cycle-offset=P1D)
		script = rose task-run --verbose
		[[[job]]]
			execution time limit = PT3H
		[[[events]]]
61 62
			mail events = submission timeout, execution timeout, failed
			mail to = {{MAIL_TO}}
63 64 65 66 67 68 69 70 71 72 73 74
			submission timeout = P1D
		[[[environment]]]
			START_DATE=$(rose date --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
			END_DATE=$(rose date --offset=P1D --print-format='%Y-%m-%d %H:%M:%S' $CYLC_TASK_CYCLE_POINT)
			START_DATE_STR=$(rose date --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
			END_DATE_STR=$(rose date --offset=P1D --print-format='%Y-%m-%d_%H:%M:%S' $CYLC_TASK_CYCLE_POINT)
			START_DAY=$(rose date --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)
			END_DAY=$(rose date --offset=P1D --print-format='%Y-%m-%d' $CYLC_TASK_CYCLE_POINT)

			GRID_NAME={{GRID_NAME}}
			RIVER_MODEL_PATH={{RIVER_MODEL_PATH}}
			REMOTE_TRANSFER_DIR={{REMOTE_TRANSFER_DIR}}
75
			ARCHIVE_DIR={{ARCHIVE_DIR}}
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

			HARMONICS_FILE_PATH={{HARMONICS_FILE_PATH}}
			CMEMS_DATA_DIR={{CMEMS_DATA_DIR}}
			NEST_RUN_SUITE={{NEST_RUN_SUITE}}
			NEST_INTERVAL={{NEST_INTERVAL}}

			EXT_TSTEP={{EXT_TSTEP}}
			ISPLIT={{ISPLIT}}
			STARTUP_DMAX={{STARTUP_DMAX}}
			HORIZONTAL_MIXING_COEFFICIENT={{HORIZONTAL_MIXING_COEFFICIENT}}
			VERTICAL_MIXING_COEFFICIENT={{VERTICAL_MIXING_COEFFICIENT}}
			COORDINATES={{COORDINATES}}
			WIND_ON={{WIND_ON}}
			HEATING_ON={{HEATING_ON}}
			PRECIPITATION_ON={{PRECIPITATION_ON}}
			AIR_PRESSURE_ON={{AIR_PRESSURE_ON}}

93 94 95
			TEMP_ACTIVE={{TEMP_ACTIVE}}
			SALT_ACTIVE={{SALT_ACTIVE}}

96 97
			WRF_FORECAST_FILE_DIR={{WRF_FORECAST_FILE_DIR}}
			WRF_ARCHIVE_DIR={{WRF_ARCHIVE_DIR}}
98 99 100 101 102 103 104 105 106 107 108 109 110
			COMMON_FILES_PATH={{COMMON_FILES_PATH}}
{%- if BOUNDARY_FORCING == 'TIDAL' %}
			ELEV_FORCE='T'
{%- else %}
			ELEV_FORCE='F'
{%- endif %}

	[[slurm_job]]
		[[[job]]]
			batch system = slurm
			submission polling intervals = PT10S
			execution polling intervals = PT10S, PT1M
		[[[directives]]]
Mike Bedington's avatar
Mike Bedington committed
111
			--nodes = {{MIN_NODES}}-{{MAX_NODES}}
112 113 114 115 116 117
			--ntasks-per-node=20
			--threads-per-core=1
			--time=24:00:00
{%- if USE_CETO %}
		[[[remote]]]
			host = login.ceto.npm.ac.uk
118
			owner = {{REMOTE_USER}}
119 120 121 122 123 124 125 126 127 128 129 130
{%- endif %}
	[[slurm_job_1]]
		inherit = slurm_job
		[[[directives]]]
			--nodes = 1
			--ntasks-per-node = 1
			--threads-per-core=1
			--time=24:00:00
	[[remote_job]]
{%- if USE_CETO %}
		[[[remote]]]
			host = login.ceto.npm.ac.uk
131
			owner = {{REMOTE_USER}}
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
{%- endif %}


	[[write_run_namelist]]
		inherit = slurm_job_1
{%- if SEDIMENT %}
	[[write_run_cstms]]
{%- endif %}

	[[copy_common_to_remote]]
		inherit = remote_job
    [[softlink_forcing]]
    [[softlink_forcing_remote]]
        inherit = slurm_job_1
	
	[[wrf_suite_trigger]]
		script =""
		[[[suite state polling]]]
			interval = PT1M
			max-polls = 1440
		[[[job]]]
			execution retry delays = 3*PT15M
	[[get_wrf_file]]
		inherit = slurm_job_1


	[[generate_tide_forcing]]
		inherit = slurm_job_1
160
    	[[CMEMS_download_trigger]]
161 162 163 164 165 166
        script =""
        [[[suite state polling]]]
            interval = PT1M
            max-polls = 1440
        [[[job]]]
            execution retry delays = 3*PT15M
167
	[[generate_CMEMS_nest]]
Mike Bedington's avatar
Mike Bedington committed
168 169 170 171
	[[copy_CMEMS_nest_to_remote]]
		inherit = remote_job
		script = "cp /pml${REMOTE_TRANSFER_DIR}/boundary_nest.nc ${ROSE_DATAC}/${GRID_NAME}_nest_0001.nc"

172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
	[[nest_suite_trigger]]
		script =""
		[[[suite state polling]]]
			interval = PT1M
			max-polls = 1440
	[[get_nest_file]]
		inherit = slurm_job_1

	[[wrf_archive_trigger]]
		script =""
		[[[suite state polling]]]
			interval = PT1M
			max-polls = 1440
		[[[job]]]
			execution retry delays = 3*PT15M
	[[update_river_model]]
	[[generate_rivers]]
	[[get_river_files]]
		inherit = slurm_job_1
	[[mv_river_files]]
		inherit = remote_job
	[[write_river_number]]
		inherit = slurm_job_1
		script = """
				NO_RIVERS=$(grep "&NML_RIVER" ${ROSE_DATAC}/${GRID_NAME}_riv.nml | wc -l);
				sed -i "s|.*RIVER_NUMBER.*| RIVER_NUMBER  = ${NO_RIVERS},|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
				"""

	[[run_fvcom]]
		inherit = slurm_job
	[[hot_cold_start]]
		inherit = remote_job
{%- if COLD_START %}
		script = """
			sed -i "s|.*STARTUP_TYPE.*|STARTUP_TYPE = 'coldstart',|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
			sed -i "s|.*STARTUP_FILE.*|STARTUP_FILE = 'none',|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
			sed -i "s|.*STARTUP_UV_TYPE.*|STARTUP_UV_TYPE   = 'default',|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
			sed -i "s|.*STARTUP_TURB_TYPE.*|STARTUP_TURB_TYPE = 'default',|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
			sed -i "s|.*STARTUP_TS_TYPE.*|STARTUP_TS_TYPE   = 'constant',|" ${ROSE_DATAC}/${GRID_NAME}_run.nml
	{%- if SEDIMENT %}
			sed -i "s|.*SED_HOT_START.*|SED_HOT_START = F|" ${ROSE_DATAC}/cstms_sediment.inp
	{%- endif %}
			"""
{%- endif %}
	[[transfer_data]]
		inherit = slurm_job_1
	[[start_cycle]]
		script = """
			echo "starting forecast cycle"
			"""
	[[transfer_restart]]
		inherit = slurm_job
		script = """
			ln -s ${ROSE_DATACP1D}/output/${GRID_NAME}_restart_0001.nc ${ROSE_DATAC}/${GRID_NAME}_restart_0001.nc
			"""