Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
autoicon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
w2w
autoicon
Commits
9e42a363
Commit
9e42a363
authored
1 year ago
by
Oriol Tintó
Browse files
Options
Downloads
Patches
Plain Diff
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
1 year ago
Stage: run_tests
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/event-generator/interpolate_sst.sh
+57
-43
57 additions, 43 deletions
templates/event-generator/interpolate_sst.sh
with
57 additions
and
43 deletions
templates/event-generator/interpolate_sst.sh
+
57
−
43
View file @
9e42a363
...
@@ -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")
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment