-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathatw_atmos_ts_monthly_index.csh
161 lines (142 loc) · 4.61 KB
/
atw_atmos_ts_monthly_index.csh
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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
160
161
#!/bin/tcsh -f
#------------------------------------
# MOAB batch directives
#PBS -N frepp.atw_atmos_ts_monthly_index.csh
#PBS -l walltime=18:00:00
#PBS -l size=1
#PBS -j oe
#PBS -o $HOME/msub_output/
#PBS -r y
#------------------------------------
# SGE batch directives
#$ -l h_cpu=18:00:00
#$ -pe ic.postp 2
#$ -j y
#$ -o $HOME/qsub_output
#$ -r y
#------------------------------------
#
#NAME
# frepp.atw_atmos_ts_monthly_index.csh
#
#SYNOPSIS
# Use frepp to create figures and statistics from atmospheric data.
#
#DESCRIPTION
# Creates figures and statistics from atmospheric data. This script is just
# a simple wrapper around a more general workhorse script. Here we eliminate
# several options of that script by instead relying on frepp to set their
# values.
#
# If any arguments are supplied on the command line, those will replace the
# original frepp-supplied arguments which are stored in ARGU.
#
# For details: $work_script -h
#
#SOURCE DATA
# pp/atmos/ts/monthly
#
#OUTPUT
# Creates figures, statistics, and data in
# $out_dir/atw_atmos_ts_monthly/index/
#
#AUTHOR
# Andrew Wittenberg
#
#SAMPLE FREPP USAGE
#
# <component type="atmos">
# <timeSeries freq="monthly" chunkLength="20yr">
# <analysis script="script_name options"/>
# </timeSeries>
# </component>
#
# See also: http://www.gfdl.noaa.gov/fms/fre/#analysis
#
# atw 9feb2015
set name = `basename $0`
# set paths to tools
source /home/atw/.atw_env_vars
set work_script = $ATW_FRE_ANALYSIS/atw/code/atmos_ts_monthly/index/csh/index.csh
set echo2 = $ATW_UTIL/echo2
set echo
# ============== VARIABLES SET BY FREPP =============
# original arguments passed to this script when it was created by frepp
set argu
# path to NetCDF files postprocessed by frepp, as specified in XML
set in_data_dir
# input data file[s], without any path prefix;
# currently only used by timeAverage diagnostics
set in_data_file
# experiment name (as appears in output directory names)
set descriptor
# final output directory for diagnostics generated by this script
set out_dir
# working directory -- do whatever you want in here
# we may have to create this (use "mkdir -p" to be sure)
# and then clean up at end
set WORKDIR
# history directory where the original "*.nc.cpio" files are found
set hist_dir
# actual start/end years of diagnostics (start_year & end_year in XML)
set yr1
set yr2
# alternate way to specify a single year (instead of yr1==yr2)
set specify_year
# Data years, only used in scripts using time series as input, to
# generate a Ferret descriptor file from consecutive NetCDF chunks.
# start year of first chunk
set databegyr
# end year of last chunk
set dataendyr
# chunk length (an integer number), as specified in XML
set datachunk
# first year of integration (4-digits, e.g. the year of initial condition)
set MODEL_start_yr
# a string: "monthly" or "annual" for timeseries data
set freq
# a string to indicate the mode: "batch" or "interactive"
set mode
# Specify MOM version; "om2" or "om3" because some files depend on mom's grid
set mom_version
# full path to the grid specification file, which contains the land/sea mask
set gridspecfile
# atmospheric land mask file
set staticfile
# the following variables are used for model-model comparisons only
set yr1_2
set yr2_2
set descriptor_2
set in_data_dir_2
set databegyr_2
set dataendyr_2
set datachunk_2
set staticfile_2
# ============== END OF VARIABLES SET BY FREPP =============
# If any arguments were supplied on the command line, then those
# will replace the original frepp-supplied arguments.
if ($#argv) set argu = ($argv:q)
# =============== START BODY OF SCRIPT ==============
if ($yr1_2 == "") then
set ref_opt
else
set ref_opt = (-r gfdl_model,$yr1_2,$yr2_2,$descriptor_2,$in_data_dir_2,$databegyr_2,$dataendyr_2,$datachunk_2,$staticfile_2)
endif
#$work_script -o $out_dir $ref_opt \
# -m gfdl_model,$yr1,$yr2,$descriptor,$in_data_dir,$databegyr,$dataendyr,$datachunk,$staticfile \
# $argu:q || goto err
# =============== START BODY OF SCRIPT ==============
set argu_test1 = "-r obs -v t_surf_nino3,t_surf_nino34,t_surf_nino4,t_surf_nino12 plot_tave_spectrum"
$work_script -o $out_dir $ref_opt \
-m gfdl_model,$yr1,$yr2,$descriptor,$in_data_dir,$databegyr,$dataendyr,$datachunk,$staticfile \
$argu_test1 || goto err
set argu_test2 = "-v t_surf_nino3,t_surf_nino34,t_surf_nino4,t_surf_nino12 plot_wavelet_density"
$work_script -o $out_dir $ref_opt \
-m gfdl_model,$yr1,$yr2,$descriptor,$in_data_dir,$databegyr,$dataendyr,$datachunk,$staticfile \
$argu_test2 || goto err
# ================ END BODY OF SCRIPT ===============
unset echo
exit 0
err:
$echo2 "$name aborted on error."
exit 1