Skip to content
Snippets Groups Projects
Commit 9e42a363 authored by Oriol Tintó's avatar Oriol Tintó
Browse files

Adding ulimit -s unlimited before the call to iconremap. Adding function imterpolate_extpar.

parent ab9adb35
No related branches found
No related tags found
No related merge requests found
Pipeline #19074 passed
...@@ -4,7 +4,7 @@ function interpolate_SST() { ...@@ -4,7 +4,7 @@ function interpolate_SST() {
local SST_OUTPUT="$3" local SST_OUTPUT="$3"
remap_namelist="tmp_sst_remap.nmp" remap_namelist="tmp_sst_remap.nmp"
cat > ${remap_namelist} <<END cat >${remap_namelist} <<END
&remap_nml &remap_nml
in_filename = "${SST_INPUT}" in_filename = "${SST_INPUT}"
...@@ -23,6 +23,7 @@ function interpolate_SST() { ...@@ -23,6 +23,7 @@ function interpolate_SST() {
END END
ulimit -s unlimited
iconremap --remap_nml ${remap_namelist} -vvv iconremap --remap_nml ${remap_namelist} -vvv
# Remove namelist # Remove namelist
...@@ -30,48 +31,45 @@ END ...@@ -30,48 +31,45 @@ END
} }
#function interpolate_extpar() { function interpolate_extpar() {
#
#GRID_FILE=icon_grid_0010_R02B04_G.nc local GRID_FILE="$1"
# local EXTERNAL_PARAMETERS_FILE="$2"
#
# echo "Converting extpar file to ICON grid"
#if [[ ! -e "$GRID_FILE" ]] ; then
#echo "Downloading files" cat >remap.nml <<END
#
#wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/icon_grid_0024_R02B06_G.nc -P . &remap_nml
#wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/icon_extpar_0024_R02B06_G_20200917_tiles.nc -P . in_filename = "${EXTERNAL_PARAMETERS_FILE}"
#wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/${GRID_FILE} -P . in_grid_filename = "${EXTERNAL_PARAMETERS_GRID}"
# in_type = 2
#fi out_grid_filename = "${GRID_FILE}"
# out_filename = "extpar.nc"
# out_type = 2
#echo "Converting extpar file to ICON grid" out_filetype = 4
# /
#cat > remap.nml << END END
#
#&remap_nml cat <<END >extend_remap_namelist.py
#in_filename = "icon_extpar_0024_R02B06_G_20200917_tiles.nc" import xarray as xr
#in_grid_filename = "icon_grid_0024_R02B06_G.nc"
#in_type = 2 with xr.open_dataset("${EXTERNAL_PARAMETERS_FILE}") as ds, open('remap.nml', 'a') as file:
#out_grid_filename = "${GRID_FILE}" for ida, da in enumerate(ds):
#out_filename = "extpar.nc" if da in ["clat","clon","lat","lon"]:
#out_type = 2 continue
#out_filetype = 4 file.write('&input_field_nml\n')
#/ file.write(f'inputname = "{da}"\n')
# file.write(f'outputname = "{da}"\n')
# file.write('/\n\n')
#END END
#
#python3 create_extpar_conversion_namelist.py python3 extend_remap_namelist.py
#
# ulimit -s unlimited
#module purge iconremap --remap_nml remap.nml #-vvv
#module load icon-tools/2.4.14.1-gcc-11.2.0 rm remap.nml
# }
#iconremap --remap_nml remap.nml #-vvv
#rm remap.nml
#}
# #
# #
#function extend_remap_namelist() { #function extend_remap_namelist() {
...@@ -87,3 +85,19 @@ END ...@@ -87,3 +85,19 @@ END
## file.write(f'outputname = "{da}"\n') ## file.write(f'outputname = "{da}"\n')
## file.write('/\n\n') ## file.write('/\n\n')
#} #}
# Add sst field to analysis file.
#import xarray as xr
#import os
#import numpy as np
#
#os.environ['ECCODES_GRIB_NO_INDEX'] = '1'
#ds=xr.open_dataset("analysis.grib")
#
#date=ds.time.values
#day_of_year = int((date - np.datetime64(date.astype('datetime64[Y]'))) / np.timedelta64(1, 'D'))
#sst=xr.open_dataset("sst_clim.nc").isel(time=day_of_year+1)
#
#ds["T_SEA"]=sst
#
#ds.to_netcdf("analysis.nc")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment