3737The script reads ensembles of realizations from scratch disk from
3838<RUN_PATH> directory::
3939
40- share/results/grids/geogrid --<propertyname>.roff.
40+ share/results/grids/<geogridname> --<propertyname>.roff.
4141
4242Optionally also temporary field parameters coming from APS or petrophysical
4343field parameters can be used to calculate mean and standard deviations.
172172
173173 # Specify which geogrid fields to use
174174 # Geogrid fields are typically found in:
175- # <RUN_PATH>/share/results/grids/geogrid --<property-name>.roff
175+ # <RUN_PATH>/share/results/grids/<geogridname> --<property-name>.roff
176176 # Optional keyword
177177 geogrid_fields:
178+ # Prefix (name of geogrid) to be used for field parameters related to the
179+ # geogrid.
180+ geogrid_name: "geogrid"
181+
178182 # Selected set of zone names to use in calculations of statistics.
179183 # Must be one or more of the defined zones.
180184 # Require at least one zone to be selected.
201205 # For each zone specify which discrete parameter to use to calculate
202206 # facies probability estimates.
203207 # Possible names are those found in the
204- # share/results/grids/geogrid --<name>.roff
208+ # share/results/grids/<geogridname> --<name>.roff
205209 # files that are of discrete type.
206210 # This key can be omitted or some of the lines specifying parameters
207211 # for a zone if you don't want to use it.
213217 # For each zone specify which continuous parameter to use to
214218 # calculate estimate of mean and stdev over ensemble.
215219 # Possible names are those found in the
216- # share/results/grids/geogrid --<name>.roff
220+ # share/results/grids/<geogridname> --<name>.roff
217221 # files that are of continuous type
218222 # This key can be omitted or some of the lines specifying
219223 # parameters for a zone if you don't want to use it.
@@ -608,17 +612,20 @@ def read_ensemble_realization(
608612 iter_number ,
609613 property_param_name ,
610614 zone_code_names ,
615+ geogrid_name ,
611616):
612617 realization_path = Path (f"realization-{ realization_number } /iter-{ iter_number } " )
613- grid_path = Path ("share/results/grids/geogrid .roff" )
618+ grid_path = Path ("share/results/grids/" + geogrid_name + " .roff" )
614619 file_path_grid = Path (ensemble_path ) / realization_path / grid_path
615620 if file_path_grid .exists ():
616621 grid = xtgeo .grid_from_file (file_path_grid , fformat = "roff" )
617622 subgrids = grid .subgrids if grid .subgrids else None
618623 else :
619624 return None , None , None
620625
621- property_path = Path (f"share/results/grids/geogrid--{ property_param_name } .roff" )
626+ property_path = Path (
627+ "share/results/grids/" + geogrid_name + f"--{ property_param_name } .roff"
628+ )
622629 file_path_property = Path (ensemble_path ) / realization_path / property_path
623630 property_param = xtgeo .gridproperty_from_file (file_path_property , fformat = "roff" )
624631
@@ -635,9 +642,10 @@ def read_geogrid_realization(
635642 realization_number ,
636643 iter_number ,
637644 zone_code_names ,
645+ geogrid_name ,
638646):
639647 realization_path = Path (f"realization-{ realization_number } /iter-{ iter_number } " )
640- grid_path = Path ("share/results/grids/geogrid .roff" )
648+ grid_path = Path ("share/results/grids/" + geogrid_name + " .roff" )
641649 file_path_grid = Path (ensemble_path ) / realization_path / grid_path
642650 if file_path_grid .exists ():
643651 grid = xtgeo .grid_from_file (file_path_grid , fformat = "roff" )
@@ -778,6 +786,7 @@ def write_mean_stdev_nactive(
778786 result_path ,
779787 ens_path ,
780788 zone_code_names ,
789+ geogrid_name ,
781790 copy_to_geogrid_realization = False ,
782791):
783792 output_path = result_path
@@ -826,7 +835,11 @@ def write_mean_stdev_nactive(
826835 # Use realization number 0
827836 real_number = 0
828837 geogrid_dimensions , geogrid_subgrids = read_geogrid_realization (
829- ens_path , real_number , iter_number , zone_code_names
838+ ens_path ,
839+ real_number ,
840+ iter_number ,
841+ zone_code_names ,
842+ geogrid_name ,
830843 )
831844
832845 ertbox_to_geogrid_statistics (
@@ -839,6 +852,7 @@ def write_mean_stdev_nactive(
839852 ertbox_dims ,
840853 conformity ,
841854 ens_path ,
855+ geogrid_name ,
842856 param_name = param_name ,
843857 )
844858
@@ -852,6 +866,7 @@ def write_mean_stdev_nactive(
852866 ertbox_dims ,
853867 conformity ,
854868 ens_path ,
869+ geogrid_name ,
855870 param_name = param_name ,
856871 )
857872
@@ -875,13 +890,14 @@ def ertbox_to_geogrid_statistics(
875890 ertbox_dimensions ,
876891 zone_conformity ,
877892 ens_path ,
893+ geogrid_name ,
878894 param_name = None ,
879895 facies_name = None ,
880896):
881897 if param_name :
882- geogrid_stat_name = f"geogrid --{ statistics_name } _{ param_name } "
898+ geogrid_stat_name = f"{ geogrid_name } --{ statistics_name } _{ param_name } "
883899 if facies_name :
884- geogrid_stat_name = f"geogrid --{ statistics_name } _{ facies_name } "
900+ geogrid_stat_name = f"{ geogrid_name } --{ statistics_name } _{ facies_name } "
885901 assert (param_name is not None ) or (facies_name is not None )
886902 geogrid_stat_file_name = (
887903 ens_path
@@ -930,6 +946,7 @@ def write_fraction_nactive(
930946 result_path ,
931947 ens_path ,
932948 zone_code_names ,
949+ geogrid_name ,
933950 ncount_active_values = None ,
934951 copy_to_geogrid_realization = False ,
935952):
@@ -979,7 +996,11 @@ def write_fraction_nactive(
979996 # Use realization number 0
980997 real_number = 0
981998 geogrid_dimensions , geogrid_subgrids = read_geogrid_realization (
982- ens_path , real_number , iter_number , zone_code_names
999+ ens_path ,
1000+ real_number ,
1001+ iter_number ,
1002+ zone_code_names ,
1003+ geogrid_name ,
9831004 )
9841005 ertbox_to_geogrid_statistics (
9851006 "prob" ,
@@ -991,6 +1012,7 @@ def write_fraction_nactive(
9911012 ertbox_dimensions ,
9921013 conformity ,
9931014 ens_path ,
1015+ geogrid_name ,
9941016 facies_name = facies_name ,
9951017 )
9961018
@@ -1042,6 +1064,14 @@ def get_specifications(input_dict, ertbox_size, ert_config_path):
10421064 use_geogrid_fields = True
10431065 geogrid_fields_dict = input_dict ["geogrid_fields" ]
10441066
1067+ key = "geogrid_name"
1068+ if key in geogrid_fields_dict :
1069+ geogrid_name = geogrid_fields_dict [key ]
1070+ geogrid_name = geogrid_name .strip ()
1071+ else :
1072+ # Set default
1073+ geogrid_name = "geogrid"
1074+
10451075 key = "zone_code_names"
10461076 if key in geogrid_fields_dict :
10471077 zone_code_names = geogrid_fields_dict [key ]
@@ -1119,6 +1149,7 @@ def get_specifications(input_dict, ertbox_size, ert_config_path):
11191149 zone_names_used ,
11201150 zone_conformity ,
11211151 zone_code_names ,
1152+ geogrid_name ,
11221153 param_name_dict ,
11231154 disc_param_name_dict ,
11241155 init_path ,
@@ -1254,6 +1285,7 @@ def calc_stats(
12541285 zone_names ,
12551286 zone_conformity ,
12561287 zone_code_names ,
1288+ geogrid_name ,
12571289 param_name_dict ,
12581290 disc_param_name_dict ,
12591291 _ ,
@@ -1290,6 +1322,7 @@ def calc_stats(
12901322 iter_number ,
12911323 param_name ,
12921324 zone_code_names ,
1325+ geogrid_name ,
12931326 )
12941327 )
12951328 if grid_dimensions is None :
@@ -1342,6 +1375,7 @@ def calc_stats(
13421375 result_path ,
13431376 ens_path ,
13441377 zone_code_names ,
1378+ geogrid_name ,
13451379 copy_to_geogrid_realization = copy_to_geogrid_realization ,
13461380 )
13471381 has_written_nactive = True
@@ -1377,6 +1411,7 @@ def calc_stats(
13771411 iter_number ,
13781412 param_name ,
13791413 zone_code_names ,
1414+ geogrid_name ,
13801415 )
13811416 )
13821417
@@ -1439,6 +1474,7 @@ def calc_stats(
14391474 result_path ,
14401475 ens_path ,
14411476 zone_code_names ,
1477+ geogrid_name ,
14421478 ncount_active_values = sum_active ,
14431479 copy_to_geogrid_realization = copy_to_geogrid_realization ,
14441480 )
@@ -1453,6 +1489,7 @@ def calc_stats(
14531489 result_path ,
14541490 ens_path ,
14551491 zone_code_names ,
1492+ geogrid_name ,
14561493 copy_to_geogrid_realization = copy_to_geogrid_realization ,
14571494 )
14581495 txt4 = f" Sum facies volume fraction: { sum_fraction } "
0 commit comments