Skip to content
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

Add capability of copying files from lustre to s3 bucket on AWS #2873

Draft
wants to merge 85 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
103f2c4
compiled OK now
weihuang-jedi Jun 18, 2024
916ff6c
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jun 19, 2024
b0ac406
re-test on aws with fewer changes
weihuang-jedi Jun 19, 2024
3de972f
make change in tasks.py to avoid error finding libiomp5.so problem
weihuang-jedi Jun 21, 2024
8308375
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jun 21, 2024
bc4c4a8
add comments so the reviewers know that these changes are for AWS, an…
weihuang-jedi Jun 22, 2024
924aede
Merge branch 'aws-forecast-only' of ssh://github.com/NOAA-EPIC/global…
weihuang-jedi Jun 22, 2024
b724937
add comments so the reviewers know that these changes are for AWS, an…
weihuang-jedi Jun 22, 2024
12ab29f
reverse config.resource changes, and memory restriction on AWS
weihuang-jedi Jun 25, 2024
adff250
sync with emc repo
weihuang-jedi Jun 25, 2024
2290ea2
move common data to a shared place
weihuang-jedi Jun 26, 2024
cd2c8e7
use ICs from s3-bucket
weihuang-jedi Jun 26, 2024
4e144e5
Merge branch 'develop' into aws-forecast-only
weihuang-jedi Jun 26, 2024
46e3ef5
change as suggested by reviewer
weihuang-jedi Jul 2, 2024
32f13eb
sync with develop
weihuang-jedi Jul 2, 2024
a34a4c8
sync sorc/ufs_model.fd
weihuang-jedi Jul 4, 2024
44011a3
remove mpmd_opt from APRUN_UFS
weihuang-jedi Jul 4, 2024
965ec80
mpmd_opt and switch off tracker/genesis default for AWS
weihuang-jedi Jul 5, 2024
3ce268e
add TODO
weihuang-jedi Jul 5, 2024
f03ac78
remove ncl version on AWS
weihuang-jedi Jul 6, 2024
007a56b
Merge remote-tracking branch 'origin/develop' into aws-forecast-only
weihuang-jedi Jul 6, 2024
2f6ec6e
sync ufs_model
weihuang-jedi Jul 6, 2024
dba83a7
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 10, 2024
24fe804
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 12, 2024
e8a2e0f
sync and remove gempak from noaacloud
weihuang-jedi Jul 12, 2024
4013eb1
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 15, 2024
a548c7f
update modules hash
weihuang-jedi Jul 15, 2024
d37e646
update module hash
weihuang-jedi Jul 15, 2024
2a80162
use bucket
weihuang-jedi Jul 17, 2024
fa44862
remove /scratch1, but kept TODO
weihuang-jedi Jul 17, 2024
55c7e7e
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 17, 2024
07851dc
re-sync
weihuang-jedi Jul 19, 2024
492808d
sync
weihuang-jedi Jul 19, 2024
d7a262e
add is_exclusive to resource.AWSPW
weihuang-jedi Jul 23, 2024
af573af
sync hash with EMC repo
weihuang-jedi Jul 23, 2024
0929180
remove --export=ALL from native, when is_exclusive set true
weihuang-jedi Jul 23, 2024
06fecca
sync
weihuang-jedi Jul 23, 2024
d8783ab
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 25, 2024
d22bc6d
Merge remote-tracking branch 'origin/develop' into aws-forecast-only
weihuang-jedi Jul 25, 2024
a5c441f
Merge branch 'aws-forecast-only' of ssh://github.com/NOAA-EPIC/global…
weihuang-jedi Jul 25, 2024
77e8233
Make AWS works similar to on-prem machine
weihuang-jedi Jul 25, 2024
96f73ba
remove --export=ALL from 'native'
weihuang-jedi Jul 25, 2024
a33a3be
remove --export=ALL from 'native'
weihuang-jedi Jul 25, 2024
80b294b
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 25, 2024
01a8928
add py-f90nml to noaacloud modulefile
weihuang-jedi Jul 25, 2024
b035947
remove un-necessary added lines
weihuang-jedi Jul 25, 2024
bf3b460
remove un-necessary added lines
weihuang-jedi Jul 25, 2024
47627ff
remove added lines which was originally for AWS, but should be define…
weihuang-jedi Jul 26, 2024
7bf8900
restore as develop
weihuang-jedi Jul 26, 2024
0685a8f
try to fix pynorms error
weihuang-jedi Jul 29, 2024
381403d
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 29, 2024
0e71f7d
Merge branch 'aws-forecast-only' of ssh://github.com/NOAA-EPIC/global…
weihuang-jedi Jul 29, 2024
2024835
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Jul 30, 2024
2c52016
sync with EMC repo
weihuang-jedi Jul 30, 2024
cd6c541
sync Gaea link with EMC repo, and only include blocks/packs that run …
weihuang-jedi Jul 30, 2024
1f60ed0
Merge branch 'aws-forecast-only' of github.com:NOAA-EPIC/global-workf…
weihuang-jedi Jul 30, 2024
e1a57b4
merge fro develop
weihuang-jedi Jul 30, 2024
fe9a457
Remove ACCOUNT_SERVICE
weihuang-jedi Jul 31, 2024
5c6e052
Merge branch 'NOAA-EMC:develop' into aws-forecast-only
weihuang-jedi Aug 1, 2024
1a273ae
Merge branch 'develop' of ssh://github.com/NOAA-EPIC/global-workflow-…
weihuang-jedi Aug 2, 2024
cc0ae02
update AWSPW.env for coupled model
weihuang-jedi Aug 2, 2024
7bf88dd
Merge remote-tracking branch 'origin/develop' into aws-coupled-atm-oc…
weihuang-jedi Aug 5, 2024
c429225
Merge remote-tracking branch 'origin/develop' into aws-coupled-atm-oc…
weihuang-jedi Aug 8, 2024
c2b765d
add C768
weihuang-jedi Aug 8, 2024
199e8be
Merge branch 'NOAA-EMC:develop' into aws-coupled-atm-ocn-ic3-c192
weihuang-jedi Aug 8, 2024
e9734a9
make c48s2sw run, but have issue with gfswavepostpnt
weihuang-jedi Aug 8, 2024
a96dcca
sync
weihuang-jedi Aug 9, 2024
1920240
synce with develop
weihuang-jedi Aug 22, 2024
0fafa6b
turn off wave on CSPs
weihuang-jedi Aug 22, 2024
3256945
sync with develop
weihuang-jedi Aug 23, 2024
aa43bcb
Merge branch 'NOAA-EMC:develop' into aws-coupled-atm-ocn-ic3-c192
weihuang-jedi Aug 23, 2024
398d40d
Merge branch 'NOAA-EMC:develop' into aws-coupled-atm-ocn-ic3-c192
weihuang-jedi Aug 23, 2024
1ca7d1f
sync with develop
weihuang-jedi Aug 26, 2024
fd90543
revert change to develop
weihuang-jedi Aug 27, 2024
219117f
Merge branch 'NOAA-EMC:develop' into aws-coupled-atm-ocn-ic3-c192
weihuang-jedi Aug 27, 2024
3911fd2
revert and sync to develop
weihuang-jedi Aug 27, 2024
fb1b45d
Merge branch 'aws-coupled-atm-ocn-ic3-c192' of github.com:NOAA-EPIC/g…
weihuang-jedi Aug 27, 2024
c9a8a6a
create branch aws-copy2bucket
weihuang-jedi Aug 27, 2024
4e347d0
testing scripts/exglobal_atmos_products.sh
weihuang-jedi Aug 27, 2024
3c4d1f9
trying to copy over ocean-ice products
weihuang-jedi Aug 28, 2024
c322afa
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi Aug 28, 2024
5dd063a
need to mkdir for ocean/ice first
weihuang-jedi Aug 28, 2024
650ce7b
Merge branch 'develop' of github.com:NOAA-EPIC/global-workflow-cloud …
weihuang-jedi Aug 28, 2024
a06f8d2
Use [[]] instead of [] as bash prefers the double square bracket
weihuang-jedi Aug 29, 2024
c87bde0
remove commented print
weihuang-jedi Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/cases/pr/C48_ATM.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ arguments:
resdetatmos: 48
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
bucketroot: /bucket/pr-gen-results
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
1 change: 1 addition & 0 deletions ci/cases/pr/C48_S2SW.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ arguments:
resdetocean: 5.0
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
bucketroot: /bucket/pr-gen-results
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/cases/yamls/gfs_defaults_ci.yaml
1 change: 1 addition & 0 deletions ci/cases/pr/C48_S2SWA_gefs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ arguments:
start: cold
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
bucketroot: /bucket/Wei.Huang/gefsc48
idate: 2021032312
edate: 2021032312
yaml: {{ HOMEgfs }}/ci/cases/yamls/gefs_ci_defaults.yaml
Expand Down
6 changes: 6 additions & 0 deletions jobs/JGLOBAL_ATMOS_PRODUCTS
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ for grid in '0p25' '0p50' '1p00'; do
prod_dir="COM_ATMOS_GRIB_${grid}"
GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${prod_dir}:COM_ATMOS_GRIB_GRID_TMPL"
if [[ ! -d "${!prod_dir}" ]]; then mkdir -m 775 -p "${!prod_dir}"; fi

bueckt_dir="BUCKET_ATMOS_GRIB_${grid}"
GRID=${grid} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx "${bueckt_dir}:BUCKET_ATMOS_GRIB_GRID_TMPL"
if [[ ! -d "${!bueckt_dir}" ]]; then mkdir -m 775 -p "${!bueckt_dir}"; fi

echo "!bueckt_dir is set: ${!bueckt_dir}"
done

# Variables used in this job
Expand Down
3 changes: 3 additions & 0 deletions jobs/JGLOBAL_OCEANICE_PRODUCTS
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "COM_${COMPONENT^^}_HISTORY"
YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "COM_${COMPONENT^^}_GRIB"
YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "COM_${COMPONENT^^}_NETCDF"

YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "BUCKET_${COMPONENT^^}_GRIB"
YMD="${PDY}" HH="${cyc}" declare_from_tmpl -rx "BUCKET_${COMPONENT^^}_NETCDF"

###############################################################
# Run exglobal script
"${SCRgfs}/exglobal_oceanice_products.py"
Expand Down
11 changes: 8 additions & 3 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export FIXugwd=${FIXgfs}/ugwd
# GLOBAL static environment parameters
export PACKAGEROOT="@PACKAGEROOT@" # TODO: set via prod_envir in Ops
export COMROOT="@COMROOT@" # TODO: set via prod_envir in Ops
export BUCKETROOT="@BUCKETROOT@" # TODO: set via prod_envir in Ops
export COMINsyn="@COMINsyn@"

# USER specific paths
Expand Down Expand Up @@ -95,6 +96,7 @@ export assim_freq=6
export PSLOT="@PSLOT@"
export EXPDIR="@EXPDIR@/${PSLOT}"
export ROTDIR="@COMROOT@/${PSLOT}"
export BUCKETDIR="@BUCKETROOT@/${PSLOT}"

export ARCDIR="${NOSCRUB}/archive/${PSLOT}"
export ATARDIR="@ATARDIR@"
Expand Down Expand Up @@ -345,9 +347,12 @@ export DELETE_COM_IN_ARCHIVE_JOB="YES" # NO=retain ROTDIR. YES default in arc
# Number of regional collectives to create soundings for
export NUM_SND_COLLECTIVES=${NUM_SND_COLLECTIVES:-9}

# The tracker, genesis, and METplus jobs are not supported on AWS yet
# TODO: we should place these in workflow/hosts/awspw.yaml as part of AWS setup, not for general.
if [[ "${machine}" == "AWSPW" ]]; then
# The tracker, genesis, and METplus jobs are not supported on CSPs yet
# TODO: we should place these in workflow/hosts/[csp]pw.yaml as part of AWS/AZURE/GOOGLE setup, not for general.
if [[ "${machine}" =~ "PW" ]]; then
export DO_TRACKER="NO"
export DO_GENESIS="NO"
export DO_METP="NO"
export DO_WAVE="NO"
fi

Expand Down
2 changes: 2 additions & 0 deletions parm/config/gfs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export FIXgdas="${FIXgfs}/gdas"
# GLOBAL static environment parameters
export PACKAGEROOT="@PACKAGEROOT@" # TODO: set via prod_envir in Ops
export COMROOT="@COMROOT@" # TODO: set via prod_envir in Ops
export BUCKETROOT="@BUCKETROOT@" # TODO: set via prod_envir in Ops
export COMINsyn="@COMINsyn@"
export DMPDIR="@DMPDIR@"

Expand Down Expand Up @@ -121,6 +122,7 @@ export assim_freq=6
export PSLOT="@PSLOT@"
export EXPDIR="@EXPDIR@/${PSLOT}"
export ROTDIR="@COMROOT@/${PSLOT}"
export BUCKETDIR="@BUCKETROOT@/${PSLOT}"
export ROTDIR_DUMP="YES" #Note: A value of "NO" does not currently work
export DUMP_SUFFIX=""
if [[ "${PDY}${cyc}" -ge "2019092100" && "${PDY}${cyc}" -le "2019110700" ]]; then
Expand Down
23 changes: 23 additions & 0 deletions parm/config/gfs/config.com
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,26 @@ declare -rx COM_CHEM_HISTORY_TMPL=${COM_BASE}'/model/chem/history'
declare -rx COM_CHEM_ANALYSIS_TMPL=${COM_BASE}'/analysis/chem'

declare -rx COM_MED_RESTART_TMPL=${COM_BASE}'/model/med/restart'

BUCKET_BASE='${BUCKETDIR}/${RUN}.${YMD}/${HH}/${MEMDIR}'

declare -rx BUCKET_TOP_TMPL='${BUCKETDIR}/${RUN}.${YMD}/${HH}'

declare -rx BUCKET_CONF_TMPL=${BUCKET_BASE}'/conf'
declare -rx BUCKET_OBS_JEDI=${BUCKET_BASE}'/obs_jedi'

declare -rx BUCKET_ATMOS_INPUT_TMPL=${BUCKET_BASE}'/model/atmos/input'
declare -rx BUCKET_ATMOS_RESTART_TMPL=${BUCKET_BASE}'/model/atmos/restart'
declare -rx BUCKET_ATMOS_HISTORY_TMPL=${BUCKET_BASE}'/model/atmos/history'
declare -rx BUCKET_ATMOS_MASTER_TMPL=${BUCKET_BASE}'/model/atmos/master'
declare -rx BUCKET_ATMOS_GRIB_TMPL=${BUCKET_BASE}'/products/atmos/grib2'
declare -rx BUCKET_ATMOS_GRIB_GRID_TMPL=${BUCKET_ATMOS_GRIB_TMPL}'/${GRID}'

declare -rx BUCKET_OCEAN_NETCDF_TMPL=${BUCKET_BASE}'/products/ocean/netcdf'
declare -rx BUCKET_OCEAN_GRIB_TMPL=${BUCKET_BASE}'/products/ocean/grib2'
declare -rx BUCKET_OCEAN_GRIB_GRID_TMPL=${BUCKET_OCEAN_GRIB_TMPL}'/${GRID}'

declare -rx BUCKET_ICE_NETCDF_TMPL=${BUCKET_BASE}'/products/ice/netcdf'
declare -rx BUCKET_ICE_GRIB_TMPL=${BUCKET_BASE}'/products/ice/grib2'
declare -rx BUCKET_ICE_GRIB_GRID_TMPL=${BUCKET_ICE_GRIB_TMPL}'/${GRID}'

16 changes: 16 additions & 0 deletions parm/post/oceanice_products.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ ocean:
data_out:
mkdir:
- "{{ COM_OCEAN_NETCDF }}"
- "{{ BUCKET_OCEAN_NETCDF }}"
{% for grid in product_grids %}
- "{{ COM_OCEAN_GRIB }}/{{ grid }}"
- "{{ BUCKET_OCEAN_GRIB }}/{{ grid }}"
{% endfor %}
copy:
- ["{{ DATA }}/ocean_subset.nc", "{{ COM_OCEAN_NETCDF }}/{{ RUN }}.ocean.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
Expand All @@ -50,6 +52,12 @@ ocean:
- ["{{ DATA }}/ocean.{{ grid }}.grib2.idx", "{{ COM_OCEAN_GRIB }}/{{ grid }}/{{ RUN }}.ocean.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2.idx"]
{% endfor %}

- ["{{ DATA }}/ocean_subset.nc", "{{ BUCKET_OCEAN_NETCDF }}/{{ RUN }}.ocean.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
{% for grid in product_grids %}
- ["{{ DATA }}/ocean.{{ grid }}.grib2", "{{ BUCKET_OCEAN_GRIB }}/{{ grid }}/{{ RUN }}.ocean.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2"]
- ["{{ DATA }}/ocean.{{ grid }}.grib2.idx", "{{ BUCKET_OCEAN_GRIB }}/{{ grid }}/{{ RUN }}.ocean.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2.idx"]
{% endfor %}

ice:
namelist:
ftype: "ice"
Expand All @@ -64,12 +72,20 @@ ice:
data_out:
mkdir:
- "{{ COM_ICE_NETCDF }}"
- "{{ BUCKET_ICE_NETCDF }}"
{% for grid in product_grids %}
- "{{ COM_ICE_GRIB }}/{{ grid }}"
- "{{ BUCKET_ICE_GRIB }}/{{ grid }}"
{% endfor %}
copy:
- ["{{ DATA }}/ice_subset.nc", "{{ COM_ICE_NETCDF }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
{% for grid in product_grids %}
- ["{{ DATA }}/ice.{{ grid }}.grib2", "{{ COM_ICE_GRIB }}/{{ grid }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2"]
- ["{{ DATA }}/ice.{{ grid }}.grib2.idx", "{{ COM_ICE_GRIB }}/{{ grid }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2.idx"]
{% endfor %}

- ["{{ DATA }}/ice_subset.nc", "{{ BUCKET_ICE_NETCDF }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.native.f{{ '%03d' % forecast_hour }}.nc"]
{% for grid in product_grids %}
- ["{{ DATA }}/ice.{{ grid }}.grib2", "{{ BUCKET_ICE_GRIB }}/{{ grid }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2"]
- ["{{ DATA }}/ice.{{ grid }}.grib2.idx", "{{ BUCKET_ICE_GRIB }}/{{ grid }}/{{ RUN }}.ice.t{{ current_cycle | strftime('%H') }}z.{{ grid }}.f{{ '%03d' % forecast_hour }}.grib2.idx"]
{% endfor %}
24 changes: 24 additions & 0 deletions scripts/exglobal_atmos_products.sh
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@ for (( nset=1 ; nset <= downset ; nset++ )); do
prod_dir="COM_ATMOS_GRIB_${grid}"
${NCP} "pgb2${grp}file_${fhr3}_${grid}" "${!prod_dir}/${PREFIX}pgrb2${grp}.${grid}.${fhr3}"
${WGRIB2} -s "pgb2${grp}file_${fhr3}_${grid}" > "${!prod_dir}/${PREFIX}pgrb2${grp}.${grid}.${fhr3}.idx"

echo "!prod_dir: ${!prod_dir}"
bucket_dir="BUCKET_ATMOS_GRIB_${grid}"
if [[ -z ${!bucket_dir+x} ]]; then
echo "!bucket_dir is unset"
else
echo "!bucket_dir is set to: ${!bucket_dir}"
if [[ "${!prod_dir}" != "${!bucket_dir}" ]]; then
cp "pgb2${grp}file_${fhr3}_${grid}" "${!bucket_dir}/${PREFIX}pgrb2${grp}.${grid}.${fhr3}"
cp "${!prod_dir}/${PREFIX}pgrb2${grp}.${grid}.${fhr3}.idx" "${!bucket_dir}/${PREFIX}pgrb2${grp}.${grid}.${fhr3}.idx"
fi
fi
done

echo "Finished processing nset = ${nset}"
Expand Down Expand Up @@ -195,6 +207,18 @@ if [[ "${FLXGF:-}" == "YES" ]]; then
prod_dir="COM_ATMOS_GRIB_${grid}"
${NCP} "sflux_${fhr3}_${grid}" "${!prod_dir}/${PREFIX}flux.${grid}.${fhr3}"
${WGRIB2} -s "sflux_${fhr3}_${grid}" > "${!prod_dir}/${PREFIX}flux.${grid}.${fhr3}.idx"

echo "!prod_dir: ${!prod_dir}"
bucket_dir="BUCKET_ATMOS_GRIB_${grid}"
if [[ -z ${!bucket_dir+x} ]]; then
echo "!bucket_dir is unset"
else
echo "!bucket_dir is set to: ${!bucket_dir}"
if [[ "${!prod_dir}" != "${!bucket_dir}" ]]; then
cp "sflux_${fhr3}_${grid}" "${!bucket_dir}/${PREFIX}flux.${grid}.${fhr3}"
cp "${!prod_dir}/${PREFIX}flux.${grid}.${fhr3}.idx" "${!bucket_dir}/${PREFIX}flux.${grid}.${fhr3}.idx"
fi
fi
done
fi

Expand Down
2 changes: 1 addition & 1 deletion workflow/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Name of the experiment

RUNTESTS
Root directory where the test EXPDIR and COMROOT will be placed
Root directory where the test EXPDIR and COMROOT/BUCKETROOT will be placed

Output
------
Expand Down
3 changes: 3 additions & 0 deletions workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def __init__(self, app_config: AppConfig, run: str) -> None:

self.HOMEgfs = self._base['HOMEgfs']
self.rotdir = self._base['ROTDIR']
self._base['BUCKETDIR'] = '/lustre/Wei.Huang/run/GEFSTESTS/COMROOT/c48gefs'
self.bucketdir = self._base['BUCKETDIR']
self.pslot = self._base['PSLOT']
if self.run == "enkfgfs":
self.nmem = int(self._base['NMEM_ENS_GFS'])
Expand All @@ -66,6 +68,7 @@ def __init__(self, app_config: AppConfig, run: str) -> None:
envar_dict = {'RUN_ENVIR': self._base.get('RUN_ENVIR', 'emc'),
'HOMEgfs': self.HOMEgfs,
'EXPDIR': self._base.get('EXPDIR'),
'BUCKETDIR': self._base.get('BUCKETDIR'),
'NET': self._base.get('NET'),
'RUN': self.run,
'CDATE': '<cyclestr>@Y@m@d@H</cyclestr>',
Expand Down
4 changes: 4 additions & 0 deletions workflow/rocoto_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,10 @@ def main(screen):
EXPDIR = entity_values['EXPDIR']
else:
EXPDIR = '.'
if 'BUCKETDIR' in entity_values:
BUCKETDIR = entity_values['BUCKETDIR']
else:
BUCKETDIR = 'no_bucketdir'

if html_output:
html_ptr = None
Expand Down
12 changes: 12 additions & 0 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def edit_baseconfig(host, inputs, yaml_dict):
"@OCNRES@": f"{int(100.*inputs.resdetocean):03d}",
"@EXPDIR@": inputs.expdir,
"@COMROOT@": inputs.comroot,
"@BUCKETROOT@": inputs.bucketroot,
"@EXP_WARM_START@": is_warm_start,
"@MODE@": inputs.mode,
"@gfs_cyc@": inputs.gfs_cyc,
Expand Down Expand Up @@ -197,6 +198,8 @@ def _common_args(parser):
type=str, required=False, default=os.getenv('HOME'))
parser.add_argument('--expdir', help='full path to EXPDIR',
type=str, required=False, default=os.getenv('HOME'))
parser.add_argument('--bucketroot', help='full path to BUCKETROOT',
type=str, required=False, default=os.getenv('HOME'))
parser.add_argument('--idate', help='starting date of experiment, initial conditions must exist!',
required=True, type=lambda dd: to_datetime(dd))
parser.add_argument('--edate', help='end date experiment', required=True, type=lambda dd: to_datetime(dd))
Expand Down Expand Up @@ -347,6 +350,9 @@ def main(*argv):
user_inputs = input_args(*argv)
host = Host()

print('user_inputs = ', user_inputs)
print('host = ', host)

validate_user_request(host, user_inputs)

# Determine ocean resolution if not provided
Expand All @@ -355,13 +361,18 @@ def main(*argv):

rotdir = os.path.join(user_inputs.comroot, user_inputs.pslot)
expdir = os.path.join(user_inputs.expdir, user_inputs.pslot)
bucketdir = os.path.join(user_inputs.bucketroot, user_inputs.pslot)

create_rotdir = query_and_clean(rotdir, force_clean=user_inputs.overwrite)
create_expdir = query_and_clean(expdir, force_clean=user_inputs.overwrite)
create_bucketdir = query_and_clean(bucketdir, force_clean=user_inputs.overwrite)

if create_rotdir:
makedirs_if_missing(rotdir)

if create_bucketdir:
makedirs_if_missing(bucketdir)

if create_expdir:
makedirs_if_missing(expdir)
fill_EXPDIR(user_inputs)
Expand All @@ -370,6 +381,7 @@ def main(*argv):
print(f"*" * 100)
print(f'EXPDIR: {expdir}')
print(f'ROTDIR: {rotdir}')
print(f'BUCKETDIR: {bucketdir}')
print(f"*" * 100)


Expand Down
Loading