This file contains 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 | |
# 1. as normal user,extract archive : | |
#tar -xf esmf_7_0_0_src.tar | |
# 2. change the file esmf/build_config/Darwin.gfortran.default/build_rules.mk | |
# OpenMPI -------------------------------------------------- | |
#ifeq ($(shell $(ESMF_DIR)/scripts/available mpifort),mpifort) | |
#ESMF_F90DEFAULT = mpifort |
This file contains 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 | |
# installing ESMF on Ubuntu Linux | |
# pre-req : gfortran, netcdf, openmpi, python3 | |
# first mkdir /opt/esmf/7.0.0 and chown to yourself | |
# you also need a copy of esmf_7_0_0_src.tar | |
# Raphael Dussin, July 2016 | |
PYTHONBIN=/opt/Anaconda3/4.1.1/bin/ | |
CUSTOMINSTALLDIR=/opt/esmf/7.0.0 |
This file contains 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
#!/usr/bin/env python | |
import os | |
import h5py | |
import numpy as np | |
import netCDF4 as nc | |
# ------------------------------ Download from NASA server and convert to hdf5 -------------------------------------------------- | |
os.system('wget ftp://goldsmr2.sci.gsfc.nasa.gov/data/s4pa//MERRA_MONTHLY/MAC0NXASM.5.2.0/1979/MERRA300.prod.assim.const_2d_asm_Nx.00000000.hdf') | |
try: |
This file contains 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 | |
MOM6_installdir=#'where you cloned ESMG-configs' | |
MOM6_rundir=#'where you want to run the code (usually scratch)' | |
compile_fms=1 | |
compile_mom=1 | |
debug=0 | |
#--------------------------------------------------------------- |
This file contains 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
# installing ESMF on Ubuntu Linux | |
# pre-req : gfortran, netcdf, openmpi, python3 | |
# first mkdir /opt/esmf/7.0.0 and chown to yourself | |
# you also need a copy of esmf_7_0_0_src.tar | |
# Raphael Dussin, July 2016 | |
PYTHONBIN=/opt/Anaconda3/4.1.1/bin/ | |
CUSTOMINSTALLDIR=/opt/esmf/7.1.0beta | |
#------------------ installing the ESMF libraries --------------- |
This file contains 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 | |
sudo apt-get update | |
sudo apt-get autoclean | |
sudo apt-get clean | |
sudo apt-get autoremove | |
kernel_pkgs=$( dpkg -l | grep -E 'linux-image-[0-9]' | awk '{ print $2 }' ) | |
current_kernel=$( uname -r ) |
This file contains 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 pyroms | |
import matplotlib.pylab as plt | |
import numpy as np | |
def lon_section(grd,lon,debug=False): | |
''' return i,j for the section of given lon ''' | |
# use a single contour of the desired longitude | |
cont = plt.contour(grd.hgrid.lon_vert,[lon]) | |
plt.close() # contour triggers a figure | |
isection, jsection = get_broken_line_from_contour(cont,debug=debug) |
This file contains 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
def clone_ncfile(self,filein,fileout): | |
fidin = nc.Dataset(filein,'r') | |
fidout = nc.Dataset(fileout,'w',format='NETCDF3_CLASSIC') | |
fidout.description = '' | |
#Copy dimensions | |
for dname, the_dim in fidin.dimensions.iteritems(): | |
fidout.createDimension(dname, len(the_dim) if not the_dim.isunlimited() else None) | |
# Copy variables |
This file contains 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 | |
# interior rho points + 1 point on each side | |
imin=135 | |
imax=155 | |
jmin=375 | |
jmax=380 | |
iminv=$(( $imin )) | |
imaxv=$(( $imax )) |
This file contains 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
--- build_rules.mk.orig 2018-03-01 10:28:42.000000000 -0500 | |
+++ build_rules.mk 2018-03-01 10:29:01.000000000 -0500 | |
@@ -63,7 +63,7 @@ | |
ESMF_CXXLINKLIBS += -lmpi_mpifh | |
else | |
ESMF_F90DEFAULT = mpif90 | |
-ESMF_CXXLINKLIBS += -lmpi_f77 | |
+ESMF_CXXLINKLIBS += $(shell mpif90 --showme:linking) | |
endif | |
ESMF_CXXCOMPILECPPFLAGS+= -DESMF_NO_SIGUSR2 |
OlderNewer