forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexglobal_extractvars.sh
executable file
·53 lines (43 loc) · 1.78 KB
/
exglobal_extractvars.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#! /usr/bin/env bash
################################################################################
## UNIX Script Documentation Block
## Script name: exglobal_extractvars.sh
## Script description: Extracts variables from atmosphere, ocean, ice and wave
## products and saves these variables in arcdir
#######################
# Main body starts here
#######################
source "${USHgfs}/preamble.sh"
source "${USHgfs}/extractvars_tools.sh"
# Scripts used
EXTRCTVARA="${USHgfs}/atmos_extractvars.sh"
EXTRCTVARO="${USHgfs}/ocnice_extractvars.sh"
EXTRCTVARW="${USHgfs}/wave_extractvars.sh"
# Set FHMAX_HF_GFS equal to FHMAX_GFS if FHMAX_HF_GFS is greater than FHMAX_GFS
if (( FHMAX_GFS < FHMAX_HF_GFS )); then
export FHMAX_HF_GFS=${FHMAX_GFS}
fi
# Set FHOUT_WAV_EXTRACT equal to FHOUT_WAV if FHOUT_WAV is not a factor of FHOUT_WAV_EXTRACT
if (( FHOUT_WAV_EXTRACT % FHOUT_WAV != 0 )); then
FHOUT_WAV_EXTRACT=${FHOUT_WAV}
fi
# Extract variables for atmosphere
if [[ "${DO_ATM}" == "YES" ]]; then
${EXTRCTVARA} "${DATA}/atmos"
fi
# Extract variables for ocean
if [[ "${DO_OCN}" == "YES" ]]; then
export component_name="ocn"
${EXTRCTVARO} "${DATA}/ocn" "${varlist_ocn_netcdf}" "${ocnres}" "${compress_ocn}" "${FHOUT_OCN_GFS}" "${ARC_RFCST_PROD_OCN}"
fi
# Extract variables for ice
if [[ "${DO_ICE}" == "YES" ]]; then
export component_name="ice"
${EXTRCTVARO} "${DATA}/ice" "${varlist_ice_netcdf}" "${iceres}" "${compress_ice}" "${FHOUT_ICE_GFS}" "${ARC_RFCST_PROD_ICE}"
fi
# Extract variables for wave
if [[ "${DO_WAVE}" == "YES" ]]; then
export component_name="wav"
${EXTRCTVARW} "${DATA}/wav"
fi
exit 0