-
Notifications
You must be signed in to change notification settings - Fork 19
Add getting and converting ERA5 ml analyses to MPAS ICs #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
19997ba
bab0a2b
fa7e210
6ca65fc
686901c
fb26ca3
493f128
0e150cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| #!/bin/csh -f | ||
|
|
||
| # (C) Copyright 2023 UCAR | ||
| # | ||
| # This software is licensed under the terms of the Apache Licence Version 2.0 | ||
| # which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. | ||
|
|
||
| # Get GFS analysis (0-h forecast) for cold start initial conditions | ||
|
|
||
| # Process arguments | ||
| # ================= | ||
| ## args | ||
| # ArgDT: int, valid time offset beyond CYLC_TASK_CYCLE_POINT in hours | ||
| set ArgDT = "$1" | ||
|
|
||
| # ArgWorkDir: my location | ||
| set ArgWorkDir = "$2" | ||
|
|
||
| set test = `echo $ArgDT | grep '^[0-9]*$'` | ||
| set isNotInt = ($status) | ||
| if ( $isNotInt ) then | ||
| echo "ERROR in $0 : ArgDT must be an integer, not $ArgDT" | ||
| exit 1 | ||
| endif | ||
|
|
||
| date | ||
|
|
||
| # Setup environment | ||
| # ================= | ||
| source config/auto/build.csh | ||
| source config/auto/experiment.csh | ||
| source config/tools.csh | ||
| set ccyymmdd = `echo ${CYLC_TASK_CYCLE_POINT} | cut -c 1-8` | ||
| set hh = `echo ${CYLC_TASK_CYCLE_POINT} | cut -c 10-11` | ||
| set thisCycleDate = ${ccyymmdd}${hh} | ||
| set thisValidDate = `$advanceCYMDH ${thisCycleDate} ${ArgDT}` | ||
| set prevValidDate = `$advanceCYMDH ${thisCycleDate} -6` | ||
|
|
||
| source ./bin/getCycleVars.csh | ||
|
|
||
| set cyyyy = `echo ${thisValidDate} | cut -c1-4` | ||
| set cmm = `echo ${thisValidDate} | cut -c5-6` | ||
| set cdd = `echo ${thisValidDate} | cut -c7-8` | ||
| set chh = `echo ${thisValidDate} | cut -c9-10` | ||
| set datestr = "${cyyyy}-${cmm}-${cdd}_${chh}" | ||
|
|
||
| set WorkDir = ${ExperimentDirectory}/`echo "$ArgWorkDir" \ | ||
| | sed 's@{{thisValidDate}}@'${thisValidDate}'@' \ | ||
| ` | ||
| echo "WorkDir = ${WorkDir}" | ||
| mkdir -p ${WorkDir} | ||
| cd ${WorkDir} | ||
|
|
||
| # ================================================================================================ | ||
|
|
||
| if ( -e GETSUCCESS ) then | ||
| echo "$0 (INFO): GETSUCCESS file already exists, exiting with success" | ||
| echo "$0 (INFO): if regenerating the output files is desired, delete GETSUCCESS" | ||
|
|
||
| date | ||
|
|
||
| exit 0 | ||
| endif | ||
|
|
||
| # ================================================================================================ | ||
|
|
||
| echo "Getting ERA5 analysis from GDEX" | ||
|
|
||
| # Link ECMWF coefficients | ||
| ln -sf $era5_to_intBuildDir/ecmwf_coeffs . | ||
|
|
||
| # Convert ERA5 NetCDF to WPS intermediate | ||
| setenv myCommand `$era5_to_intBuildDir/$era5_to_int ${datestr}` | ||
| echo "$myCommand" | ||
| ${myCommand} | ||
|
|
||
| # Build ERA5 intermediate filename (YYYY-MM-DD_HH) | ||
| set era5file = ERA5:${datestr} | ||
|
|
||
| # Check that ERA5 intermediate file exists | ||
| if ( ! -e ${era5file} ) then | ||
| echo "${era5file} not found -- exiting" | ||
| exit 1 | ||
| endif | ||
|
|
||
| echo "ERA5 intermediate file created successfully: ${era5file}" | ||
|
|
||
| date | ||
|
|
||
| touch GETSUCCESS | ||
|
|
||
| exit 0 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,8 +116,11 @@ def __init__(self, config:Config, hpc:HPC, meshes:dict): | |
| 'queue': {'def': hpc['SharedQueue']}, | ||
| 'account': {'def': hpc['CriticalAccount']}, | ||
| } | ||
| ungribjob = Resource(self._conf, attr, ('job', 'ungrib')) | ||
| self.__ungribtask = TaskLookup[hpc.system](ungribjob) | ||
| if self['externalanalyses__UngribPrefix'] == 'GFS': | ||
| ungribjob = Resource(self._conf, attr, ('job', 'ungrib')) | ||
| self.__ungribtask = TaskLookup[hpc.system](ungribjob) | ||
| else: | ||
| self.__ungribtask = None | ||
|
|
||
| ######### | ||
| # outputs | ||
|
|
@@ -169,6 +172,25 @@ def export(self, dtOffsets:list=[0]): | |
| [['''+base+''']] | ||
| inherit = '''+base+zeroHR] | ||
|
|
||
| # ERA5 GDEX | ||
| base = 'GetERA5AnalysisFromGDEX' | ||
| queue = 'GetExternalAnalyses' | ||
| if base in self['PrepareExternalAnalysisOuter']: | ||
| subqueues.append(queue) | ||
| taskNames[base] = base+dtLen | ||
| self._tasks += [''' | ||
| [['''+taskNames[base]+''']] | ||
| inherit = '''+queue+''', SingleBatch | ||
| script = $origin/bin/'''+base+'''.csh '''+dt_work_Args+''' | ||
| execution time limit = PT20M | ||
| execution retry delays = '''+self.__getRetry] | ||
|
|
||
| # generic 0hr task name for external classes/tasks to grab | ||
| if dt == 0: | ||
| self._tasks += [''' | ||
| [['''+base+''']] | ||
| inherit = '''+base+zeroHR] | ||
|
|
||
| # GFS RDA | ||
| base = 'GetGFSAnalysisFromRDA' | ||
| queue = 'GetExternalAnalyses' | ||
|
|
@@ -210,13 +232,13 @@ def export(self, dtOffsets:list=[0]): | |
| # ungrib | ||
| base = 'UngribExternalAnalysis' | ||
| queue = 'UngribExternalAnalyses' | ||
| if base in self['PrepareExternalAnalysisOuter']: | ||
| if base in self['PrepareExternalAnalysisOuter'] and self['externalanalyses__UngribPrefixOuter'] != 'ERA5': | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When I try to run
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for pointing this out @jim-p-w! I should have checked this more carefully. I found a solution by doing |
||
| subqueues.append(queue) | ||
| taskNames[base] = base+dtLen | ||
| self._tasks += [''' | ||
| [['''+taskNames[base]+''']] | ||
| inherit = '''+queue+''', BATCH | ||
| script = $origin/bin/'''+base+'''.csh '''+dt_work_Args+''' | ||
| [['''+taskNames[base]+''']] | ||
| inherit = '''+queue+''', BATCH | ||
| script = $origin/bin/'''+base+'''.csh '''+dt_work_Args+''' | ||
| '''+self.__ungribtask.job()+self.__ungribtask.directives()] | ||
|
|
||
| # generic 0hr task name for external classes/tasks to grab | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| suite: GenerateExternalAnalyses | ||
|
|
||
| externalanalyses: | ||
| resource: "ERA5.GDEX" | ||
| experiment: | ||
| name: 'GenerateERA5Analyses' | ||
| prefix: '' | ||
| model: | ||
| outerMesh: 120km | ||
| hpc: | ||
| CriticalPriority: economy | ||
| NonCriticalPriority: economy | ||
| #CriticalQueue: main | ||
| #NonCriticalQueue: main | ||
| workflow: | ||
| first cycle point: 20220606T00 | ||
| final cycle point: 20220606T06 | ||
|
jim-p-w marked this conversation as resolved.
|
||
Uh oh!
There was an error while loading. Please reload this page.