@@ -121,16 +121,17 @@ def get_output_field_name3(field):
121
121
###############################################################################
122
122
123
123
def get_filename (taskpath , field ,output_dir ,zipstart ,zipend ,structure = 'std' ,zip_freq = 'month' ):
124
- stream_map = {'ma' :'atmos' ,'ga' :'region' ,'ka' :'atmos' ,'ko' :'ocean' }
125
124
# Different components used in file name and path
126
125
boinc = taskpath .split ('/' )[- 1 ]
127
126
128
127
# When splitting up the file name by underscore
129
128
# hadcm3 apps have one less component (e.g. compared to wah2_eu50)
130
- if boinc [:6 ]== 'hadcm3' :
129
+ if boinc [:6 ] in ['hadcm3' ,'hadam4' ]:
130
+ stream_map = {'ma' :'atmos' ,'ga' :'atmos' ,'ka' :'atmos' ,'ko' :'ocean' }
131
131
umid = boinc .split ('_' )[1 ]
132
132
datecode = boinc .split ('_' )[2 ]
133
133
else :
134
+ stream_map = {'ma' :'atmos' ,'ga' :'region' ,'ka' :'atmos' ,'ko' :'ocean' }
134
135
umid = boinc .split ('_' )[2 ]
135
136
datecode = boinc .split ('_' )[3 ]
136
137
# Get start year and month (old filenames don't contain start month so assume 12)
@@ -824,4 +825,10 @@ def read_urls(urls_file):
824
825
fh .close ()
825
826
urls = map (string .strip , urls )
826
827
return urls
828
+
829
+ #####################################################
830
+
831
+ def compress_netcdf (fname ):
832
+ os .system ('nccopy -d 2 -s ' + fname + ' ' + fname + '_compressed' )
833
+ shutil .move (fname + '_compressed' ,fname )
827
834
0 commit comments