Skip to content

Commit 7f34128

Browse files
authored
Merge pull request #87 from bertinia/master
bug fixes for timeseries
2 parents 318579f + 9006542 commit 7f34128

File tree

5 files changed

+27
-5
lines changed

5 files changed

+27
-5
lines changed

Config/config_timeseries.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,14 @@
312312
<tseries_filecat_tper>years</tseries_filecat_tper>
313313
<tseries_filecat_n>10</tseries_filecat_n>
314314
</file_extension>
315+
<file_extension suffix=".h1.[0-9]">
316+
<subdir>hist</subdir>
317+
<tseries_create>FALSE</tseries_create>
318+
<tseries_output_format>netcdf4c</tseries_output_format>
319+
<tseries_tper>day_1</tseries_tper>
320+
<tseries_filecat_tper>years</tseries_filecat_tper>
321+
<tseries_filecat_n>10</tseries_filecat_n>
322+
</file_extension>
315323
</files>
316324
<tseries_time_variant_variables>
317325
<variable>time</variable>
@@ -392,6 +400,14 @@
392400
<tseries_filecat_tper>years</tseries_filecat_tper>
393401
<tseries_filecat_n>100</tseries_filecat_n>
394402
</file_extension>
403+
<file_extension suffix=".h1.[0-9]">
404+
<subdir>hist</subdir>
405+
<tseries_create>FALSE</tseries_create>
406+
<tseries_output_format>netcdf4c</tseries_output_format>
407+
<tseries_tper>month_1</tseries_tper>
408+
<tseries_filecat_tper>years</tseries_filecat_tper>
409+
<tseries_filecat_n>10</tseries_filecat_n>
410+
</file_extension>
395411
</files>
396412
<tseries_time_variant_variables>
397413
<variable>time</variable>

Templates/batch_cheyenne.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@
4141
. /glade/u/apps/ch/opt/lmod/7.2.1/lmod/lmod/init/bash
4242

4343
export I_MPI_DEVICE=rdma
44+
export MPI_UNBUFFERED_STDIO=true

Templates/postprocess.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@ PYTHONPATH={{ pythonpath }}:$PYTHONPATH
3232
export PYTHONPATH
3333
{% endif %}
3434

35+
today="$(date '+%Y%m%d-%H%M%S')"
36+
3537
echo "******************************************"
3638
echo "Start {{ processName }} generation $(date)"
3739
echo "******************************************"
3840

3941
{% if standalone %}
40-
{{ mpirun|replace("{{ pes }}",pes) }} ./{{ postProcessCmd }} {{ debug }} {{ backtrace }} --caseroot {{ caseRoot }} --standalone >> {{ caseRoot }}/logs/{{ processName }}.log 2>&1
42+
{{ mpirun|replace("{{ pes }}",pes) }} ./{{ postProcessCmd }} {{ debug }} {{ backtrace }} --caseroot {{ caseRoot }} --standalone >> {{ caseRoot }}/logs/{{ processName }}.log.$today 2>&1
4143
{% else %}
42-
{{ mpirun|replace("{{ pes }}",pes) }} ./{{ postProcessCmd }} {{ debug }} {{ backtrace }} --caseroot {{ caseRoot }} >> {{ caseRoot }}/logs/{{ processName }}.log 2>&1
44+
{{ mpirun|replace("{{ pes }}",pes) }} ./{{ postProcessCmd }} {{ debug }} {{ backtrace }} --caseroot {{ caseRoot }} >> {{ caseRoot }}/logs/{{ processName }}.log.$today 2>&1
4345
{% endif %}
4446

4547
echo "******************************************"

ocn_diag/tool_lib/zon_avg/makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
FC = ifort
66
FFLAGS = -c -g -O2
7-
INCLUDE = -I/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/16.0.3/include
8-
LIBS = -L/glade/u/apps/ch/opt/netcdf/4.4.1.1/intel/16.0.3/lib -lnetcdff -lnetcdf
7+
INCLUDE = -I/glade/apps/opt/netcdf/4.2/intel/12.1.5/include
8+
LIBS = -L/glade/apps/opt/netcdf/4.2/intel/12.1.5/lib -lnetcdff -lnetcdf
99

1010
.SUFFIXES: # Delete the default suffixes
1111
.SUFFIXES: .F .F90 .o # Define our suffix list

timeseries/timeseries/chunking.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ def get_input_dates(glob_str):
8181
except:
8282
print 'Global attribute time_period_freq not found - set to XML tseries_tper element'
8383
first = False
84+
f.close()
8485

8586
return stream_dates,file_slices,att['calendar'].lower(),att['units'],time_period_freq
8687

@@ -287,8 +288,9 @@ def write_log(log_fn, log):
287288
log(dictionary) - keys->file streams, values->the dates that have been
288289
converted and next indexes to use for size and tper lists
289290
'''
290-
with open(log_fn, 'w') as f:
291+
with open(log_fn, 'a+') as f:
291292
json.dump(log, f)
293+
f.close()
292294

293295

294296
def read_log(log_fn):
@@ -307,6 +309,7 @@ def read_log(log_fn):
307309
if os.path.isfile(log_fn):
308310
with open(log_fn, 'r') as f:
309311
d = json.load(f)
312+
f.close()
310313
return d
311314
else:
312315
return {}

0 commit comments

Comments
 (0)