@@ -238,9 +238,11 @@ def get_glorys_data(
238238
239239 file = open (Path (path / "get_glorys_data.sh" ), "w" )
240240
241- lines .append (f"""
241+ lines .append (
242+ f"""
242243copernicusmarine subset --dataset-id cmems_mod_glo_phy_my_0.083deg_P1D-m --variable so --variable thetao --variable uo --variable vo --variable zos --start-datetime { str (timerange [0 ]).replace (" " ,"T" )} --end-datetime { str (timerange [1 ]).replace (" " ,"T" )} --minimum-longitude { longitude_extent [0 ] - buffer } --maximum-longitude { longitude_extent [1 ] + buffer } --minimum-latitude { latitude_extent [0 ] - buffer } --maximum-latitude { latitude_extent [1 ] + buffer } --minimum-depth 0 --maximum-depth 6000 -o { str (path )} -f { segment_name } .nc\n
243- """ )
244+ """
245+ )
244246 file .writelines (lines )
245247 file .close ()
246248 return Path (path / "get_glorys_data.sh" )
@@ -2865,6 +2867,9 @@ def regrid_velocity_tracers(
28652867 segment_out [f"{ coords .attrs ['parallel' ]} _{ self .segment_name } " ].size
28662868 )
28672869
2870+ segment_out [f"ny_{ self .segment_name } " ].attrs ["axis" ] = "Y"
2871+ segment_out [f"nx_{ self .segment_name } " ].attrs ["axis" ] = "X"
2872+
28682873 encoding_dict = {
28692874 "time" : {"dtype" : "double" },
28702875 f"nx_{ self .segment_name } " : {
@@ -2887,13 +2892,7 @@ def regrid_velocity_tracers(
28872892 # If repeat-year forcing, add modulo coordinate
28882893 if self .repeat_year_forcing :
28892894 segment_out ["time" ] = segment_out ["time" ].assign_attrs ({"modulo" : " " })
2890- # Add axes to suppress annoying runtime warnings
2891- segment_out [f"ny_{ self .segment_name } " ] = segment_out [
2892- f"ny_{ self .segment_name } "
2893- ].assign_attrs ({"axis" : "Y" })
2894- segment_out [f"nx_{ self .segment_name } " ] = segment_out [
2895- f"nx_{ self .segment_name } "
2896- ].assign_attrs ({"axis" : "X" })
2895+
28972896 segment_out .load ().to_netcdf (
28982897 self .outfolder / f"forcing_obc_{ self .segment_name } .nc" ,
28992898 encoding = encoding_dict ,
0 commit comments