This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of the customization for the fortran highlighting | |
# To highlight fortran in GEM model | |
path = require 'path' | |
atom.workspace.observeTextEditors (editor) -> | |
if path.extname(editor.getPath()) in [".ftn", ".ftn90", ".cdk", ".cdk90", ".f"] | |
editor.setGrammar(atom.grammars.grammarForScopeName('source.fortran.modern')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!Write temperature to a text file for debug | |
if (time_step == 1) then | |
write(line_format, "(I8)") G_ni | |
line_format = "(" // trim(line_format) // "F8.3)" | |
end if | |
write(debug_txt_filename, "(A3,I3.3,A4)") "TT_", time_step, | |
$ ".txt" | |
time_step = time_step + 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example done with Kamel Chikhar on 9/03/2015 | |
# frame1 - a frame from a file that does not contain levels and can have different number of levels for different dates | |
# and different number of dates for the same levels | |
# Create all possible multiindices | |
all_dates_unique = [start + i * day for i in range(ndays)] | |
all_levels_unique = list(reversed(np.unique(frame1["X.6"]))) | |
all_hours_unique = [i * dt.seconds // 3600 for i in range(24 * 3600 // dt.seconds)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from netCDF4 import Dataset, num2date | |
import calendar | |
import numpy as np | |
def del_feb29_in_file(in_path, varname): | |
#input file | |
dsin = Dataset(in_path) | |
if not os.path.isdir(varname): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch -n 1 cat time.step |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hdf5_lib=$(true_path ../hdf5-sf90/lib) | |
hdf5_include=$(true_path ../hdf5-sf90/include) | |
nc_lib=$(true_path ../netcdf4-sf90/lib) | |
nc_include=$(true_path ../netcdf4-sf90/include) | |
LIBS="-lnetcdf" | |
CFLAGS="-I${hdf5_include} -I${nc_include}" | |
LDFLAGS="-L${hdf5_lib} -L${nc_lib}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -x | |
CXX=s.cc CC=s.cc FC=s.f90 LD=s.f90 ./configure --prefix=$(true_path ../hdf5-sf90) --enable-fortran | |
make | |
make check | |
make install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import re | |
import os | |
#link format | |
url = "http://www.globsnow.info/se/archive_v2.1/{}/D4SC/" | |
#Year range of the data to be downloaded | |
start_year = 2003 | |
end_year = 2003 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import re | |
import os | |
url = "http://www.globsnow.info/se/archive_v2.1/{}/D4SC/" | |
start_year = 2003 | |
end_year = 2003 | |
for year in range(start_year, end_year + 1): | |
year_url = url.format(year) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This simple code demonstrates how to define a function, local and global variables in bash. | |
#And most importantly, how to launch background processes and wait for their termination | |
gvar="Glob value" | |
ncalls=0 | |
avar="Test" | |
# Note for ksh users: in ksh to mark a function definition you should use either function keyword | |
# or () after the function name, not both | |
function a_proc(){ |