Skip to content

Commit 807ef9d

Browse files
authored
Merge branch 'develop' into bugfix/borescan_elevation
2 parents 0b943c5 + 4c94e7e commit 807ef9d

File tree

1 file changed

+15
-37
lines changed
  • GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs

1 file changed

+15
-37
lines changed

GEOSagcm_GridComp/GEOSphysics_GridComp/GEOSsurface_GridComp/Utils/Raster/makebcs/make_bcs_shared.py

Lines changed: 15 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -53,39 +53,23 @@ def get_change_til_file(grid_type):
5353
script = """
5454
5555
cd geometry/{GRIDNAME}/
56-
/bin/rm -f sedfile
5756
if( {TRIPOL_OCEAN} == True ) then
58-
cat > sedfile << EOF
59-
s/CF{NC}x6C/PE{nc}x{nc6}-CF/g
60-
s/{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{OCEAN_VERSION}/g
61-
EOF
62-
sed -f sedfile {GRIDNAME}{RS}.til > tile.file
63-
/bin/mv -f tile.file {GRIDNAME}{RS}.til
64-
/bin/rm -f sedfile
65-
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
66-
ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{OCEAN_VERSION}' {GRIDNAME}{RS}.nc4
57+
sed -i 's/{OCEAN_VERSION}{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{OCEAN_VERSION}/g' {GRIDNAME}{RS}.til
58+
sed -i 's/CF{NC}x6C/PE{nc}x{nc6}-CF/g' {GRIDNAME}{RS}.til
59+
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
60+
ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{OCEAN_VERSION}' {GRIDNAME}{RS}.nc4
6761
endif
6862
if( {CUBED_SPHERE_OCEAN} == True ) then
69-
cat > sedfile << EOF
70-
s/CF{NC}x6C{SGNAME}/PE{nc}x{nc6}-CF/g
71-
s/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/OC{nc}x{nc6}-CF/g
72-
EOF
73-
sed -f sedfile {GRIDNAME}{RS}.til > tile.file
74-
/bin/mv -f tile.file {GRIDNAME}{RS}.til
75-
/bin/rm -f sedfile
76-
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
77-
ncatted -a Grid_ocn_Name,global,o,c,'OC{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
63+
sed -i 's/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/OC{nc}x{nc6}-CF/g' {GRIDNAME}{RS}.til
64+
sed -i 's/CF{NC}x6C{SGNAME}/PE{nc}x{nc6}-CF/g' {GRIDNAME}{RS}.til
65+
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
66+
ncatted -a Grid_ocn_Name,global,o,c,'OC{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
7867
endif
7968
if( {LATLON_OCEAN} == True ) then
80-
cat > sedfile << EOF
81-
s/CF{NC}x6C{SGNAME}/PE{nc}x{nc6}-CF/g
82-
s/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{DATENAME}/g
83-
EOF
84-
sed -f sedfile {GRIDNAME}{RS}.til > tile.file
85-
/bin/mv -f tile.file {GRIDNAME}{RS}.til
86-
/bin/rm -f sedfile
87-
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
88-
ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{DATENAME}' {GRIDNAME}{RS}.nc4
69+
sed -i 's/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{DATENAME}/g' {GRIDNAME}{RS}.til
70+
sed -i 's/CF{NC}x6C{SGNAME}/PE{nc}x{nc6}-CF/g' {GRIDNAME}{RS}.til
71+
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
72+
ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{DATENAME}' {GRIDNAME}{RS}.nc4
8973
endif
9074
cd ../../
9175
@@ -94,15 +78,9 @@ def get_change_til_file(grid_type):
9478

9579
script = """
9680
cd geometry/{GRIDNAME}/
97-
/bin/rm -f sedfile
98-
cat > sedfile << EOF
99-
s/DC{IM}xPC{JM}/PC{im}x{jm}-DC/g
100-
s/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{DATENAME}/g
101-
EOF
102-
sed -f sedfile {GRIDNAME}{RS}.til > tile.file
103-
/bin/mv -f tile.file {GRIDNAME}{RS}.til
104-
/bin/rm -f sedfile
105-
ncatted -a Grid_Name,global,o,c,'PE{nc}x{nc6}-CF' {GRIDNAME}{RS}.nc4
81+
sed -i 's/{DATENAME}{IMO}x{POLENAME}{JMO}-Pfafstetter/PE{imo}x{jmo}-{DATENAME}/g' {GRIDNAME}{RS}.til
82+
sed -i 's/DC{IM}xPC{JM}/PC{im}x{jm}-DC/g' {GRIDNAME}{RS}.til
83+
ncatted -a Grid_Name,global,o,c,'PC{im}x{jm}-DC' {GRIDNAME}{RS}.nc4
10684
ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{DATENAME}' {GRIDNAME}{RS}.nc4
10785
cd ../../
10886

0 commit comments

Comments
 (0)