@@ -53,39 +53,23 @@ def get_change_til_file(grid_type):
5353 script = """
5454
5555cd geometry/{GRIDNAME}/
56- /bin/rm -f sedfile
5756if( {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
6761endif
6862if( {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
7867endif
7968if( {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
8973endif
9074cd ../../
9175
@@ -94,15 +78,9 @@ def get_change_til_file(grid_type):
9478
9579 script = """
9680cd 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
10684ncatted -a Grid_ocn_Name,global,o,c,'PE{imo}x{jmo}-{DATENAME}' {GRIDNAME}{RS}.nc4
10785cd ../../
10886
0 commit comments