Skip to content

Commit

Permalink
Add the EC-EARTH-ESM-1 configuration #825.
Browse files Browse the repository at this point in the history
  • Loading branch information
treerink committed May 14, 2024
1 parent e9a0e4c commit cec4bf9
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ece2cmor3/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
'EC-EARTH-HR' : ["ifs", "nemo" ],
'EC-EARTH-LR' : ["ifs", "nemo" ],
'EC-EARTH-CC' : ["ifs", "nemo", "tm5", "lpjg" ],
'EC-EARTH-ESM' : ["ifs", "nemo", "lpjg", "co2box"], # If a PISM component is added to ece2cmor3 it needs here to be added as well.
'EC-EARTH-ESM-1' : ["ifs", "nemo", "lpjg", "co2box"], # If a PISM component is added to ece2cmor3 it needs here to be added as well.
'EC-EARTH-GrisIS' : ["ifs", "nemo" ], # If a PISM component is added to ece2cmor3 it needs here to be added as well.
'EC-EARTH-AerChem' : ["ifs", "nemo", "tm5" ],
'EC-EARTH-Veg' : ["ifs", "nemo", "lpjg" ],
Expand Down
11 changes: 7 additions & 4 deletions ece2cmor3/resources/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def keep_variable(target, model_component, ecearth_config):
if variable in ["evspsbl", "mrfso", "mrso", "mrsol", "mrsos", "mrro", "mrros", "snc", "snd", "snw", "tsl"]:
return model_component == "ifs"

# Carbon-cycle variables only activated in EC-EARTH-CC
# Carbon-cycle variables only activated in EC-EARTH-CC & EC-EARTH-ESM-1:
# The list below from the second line on is created by using:
# more basic-flat-cmip6-file_def_nemo.xml |grep pisces| sed -e 's/field_ref.*//' -e 's/^.*name=//' | sed -e 's/" .*$/",/' | sort | uniq | sed -e 's/$/ \\/' > pisces-vars.txt
if variable in ["cfc12", "cfc13", "c14", "sf6", \
"bfe", "bfeos", "bsi", "bsios", "calc", "calcos", "chl", "chldiat", "chldiatos", \
"chlmisc", "chlmiscos", "chlos", "co3", "co3os", "co3satcalc", "co3satcalcos", \
Expand All @@ -45,9 +47,10 @@ def keep_variable(target, model_component, ecearth_config):
"phydiatos", "phyfe", "phyfeos", "phymisc", "phymiscos", "physi", "physios", "pnitrate", \
"po4", "po4os", "pp", "ppdiat", "ppmisc", "ppos", "remoc", "si", "sios", "spco2", "talk", \
"talknat", "talknatos", "talkos", "zmeso", "zmesoos", "zmicro", "zmicroos", "zo2min", "zooc", "zoocos"]:
return model_component == "nemo" and ecearth_config == "EC-EARTH-CC"
# The list above from the second line on is created by using:
# more basic-flat-cmip6-file_def_nemo.xml |grep pisces| sed -e 's/field_ref.*//' -e 's/^.*name=//' | sed -e 's/" .*$/",/' | sort | uniq | sed -e 's/$/ \\/' > pisces-vars.txt
if ecearth_config == "EC-EARTH-CC":
return model_component == "nemo" and ecearth_config == "EC-EARTH-CC"
if ecearth_config == "EC-EARTH-ESM-1":
return model_component == "nemo" and ecearth_config == "EC-EARTH-ESM-1"

if variable == "co2mass":
if ecearth_config == "EC-EARTH-ESM":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,7 @@ def create_sheet_column_indices():
drqlistjson_file_name = '../resources/miscellaneous-data-requests/test-data-request/drqlist-nemo-all.json'
file_name_varlistjson_ece_cc = '../resources/miscellaneous-data-requests/test-data-request/varlist-nemo-all-ec-earth-cc.json'
file_name_varlistjson_ece_aogcm = '../resources/miscellaneous-data-requests/test-data-request/varlist-nemo-all-ec-earth-aogcm.json'
file_name_varlistjson_ece_esm_1 = '../resources/miscellaneous-data-requests/test-data-request/varlist-nemo-all-ec-earth-esm-1.json'

drqlistjson = open(drqlistjson_file_name,'w')
drqlistjson.write('{}{}'.format('{','\n'))
Expand Down Expand Up @@ -842,13 +843,15 @@ def create_sheet_column_indices():

command_2 = " drq2varlist --drq " + drqlistjson_file_name + " --varlist " + file_name_varlistjson_ece_cc + " --ececonf EC-EARTH-CC "
command_3 = " drq2varlist --drq " + drqlistjson_file_name + " --varlist " + file_name_varlistjson_ece_aogcm + " --ececonf EC-EARTH-AOGCM "
#os.system(command_1)
command_4 = " drq2varlist --drq " + drqlistjson_file_name + " --varlist " + file_name_varlistjson_ece_esm_1 + " --ececonf EC-EARTH-ESM-1 "
os.system(command_2)
os.system(command_3)
os.system(command_4)

print('\n The produced {:67} contains {:} variables.'.format(drqlistjson_file_name, i))
print(' The produced {:67} is a variant: ordened by model component, the ignored fields are dropped and the preferences are applied.'.format(file_name_varlistjson_ece_cc ))
print(' The produced {:67} is a variant: ordened by model component, the ignored fields are dropped and the preferences are applied.'.format(file_name_varlistjson_ece_aogcm))
print(' The produced {:67} is a variant: ordened by model component, the ignored fields are dropped and the preferences are applied.'.format(file_name_varlistjson_ece_esm_1))

################################################################################
################################### 7 ###################################
Expand Down
2 changes: 1 addition & 1 deletion ece2cmor3/scripts/drq2varlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def main():
else:
matches, omitted = taskloader.load_drq(args.drq, config=args.ececonf, check_prefs=True)
# Here we load extra permanent tasks for LPJ-GUESS because the LPJ_GUESS community likes to output these variables at any time independent wheter they are requested by the data request:
if args.ececonf in ["EC-EARTH-CC", "EC-EARTH-Veg", "EC-EARTH-Veg-LR"]:
if args.ececonf in ["EC-EARTH-CC", "EC-EARTH-ESM-1", "EC-EARTH-Veg", "EC-EARTH-Veg-LR"]:
matches_permanent, omitted_permanent = taskloader.load_drq(os.path.join(os.path.dirname(__file__), "..", "resources", "permanent-tasks.json"), config=args.ececonf, check_prefs=True)
for model, targetlist in list(matches_permanent.items()):
if model in matches:
Expand Down
14 changes: 8 additions & 6 deletions ece2cmor3/scripts/genecec.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
'EC-EARTH-HR' : 'CMIP,DCPP,HighResMIP',
'EC-EARTH-LR' : 'CMIP,PMIP',
'EC-EARTH-CC' : 'C4MIP,CDRMIP,CMIP,LUMIP,OMIP,ScenarioMIP',
'EC-EARTH-ESM-1' : 'C4MIP,CDRMIP,CMIP,LUMIP,OMIP,ScenarioMIP',
'EC-EARTH-GrisIS' : 'CMIP,ISMIP6,PMIP',
'EC-EARTH-AerChem' : 'AerChemMIP,CMIP,RFMIP',
'EC-EARTH-Veg' : 'CDRMIP,CMIP,LUMIP,LS3MIP,ScenarioMIP',
Expand All @@ -102,6 +103,7 @@
scenario_ece_configurations = {
'EC-EARTH-AOGCM' : 'CMIP,DCPP,LS3MIP,ScenarioMIP,CORDEX,DynVarMIP,VIACSAB',
'EC-EARTH-CC' : 'C4MIP,CDRMIP,CMIP,LUMIP,OMIP,ScenarioMIP',
'EC-EARTH-ESM-1' : 'C4MIP,CDRMIP,CMIP,LUMIP,OMIP,ScenarioMIP',
'EC-EARTH-AerChem' : 'AerChemMIP,CMIP,RFMIP,ScenarioMIP',
'EC-EARTH-Veg' : 'CMIP,LUMIP,LS3MIP,ScenarioMIP',
'EC-EARTH-Veg-LR' : 'CMIP,PMIP,ScenarioMIP'
Expand All @@ -123,23 +125,23 @@

# Define a dictionary which lists/maps for each MIP which EC-Earth3 model configurations are used to run the MIP:
ece_conf_mip_map = {
#'CMIP' : ['EC-EARTH-AOGCM','EC-EARTH-HR','EC-EARTH-LR','EC-EARTH-CC','EC-EARTH-GrisIS','EC-EARTH-AerChem','EC-EARTH-Veg','EC-EARTH-Veg-LR'],
#'CMIP' : ['EC-EARTH-AOGCM','EC-EARTH-HR','EC-EARTH-LR','EC-EARTH-CC','EC-EARTH-ESM-1','EC-EARTH-GrisIS','EC-EARTH-AerChem','EC-EARTH-Veg','EC-EARTH-Veg-LR'],
'DCPP' : ['EC-EARTH-AOGCM','EC-EARTH-HR'],
'LS3MIP' : ['EC-EARTH-AOGCM','EC-EARTH-Veg'],
'PAMIP' : ['EC-EARTH-AOGCM'],
'RFMIP' : ['EC-EARTH-AOGCM','EC-EARTH-AerChem'],
'ScenarioMIP' : ['EC-EARTH-AOGCM','EC-EARTH-CC','EC-EARTH-Veg','EC-EARTH-Veg-LR'],
'ScenarioMIP' : ['EC-EARTH-AOGCM','EC-EARTH-CC','EC-EARTH-ESM-1','EC-EARTH-Veg','EC-EARTH-Veg-LR'],
'VolMIP' : ['EC-EARTH-AOGCM'],
'CORDEX' : ['EC-EARTH-AOGCM'],
'DynVarMIP' : ['EC-EARTH-AOGCM'],
'SIMIP' : ['EC-EARTH-AOGCM'],
'VIACSAB' : ['EC-EARTH-AOGCM'],
'HighResMIP' : ['EC-EARTH-HR'],
'PMIP' : ['EC-EARTH-LR','EC-EARTH-GrisIS','EC-EARTH-Veg-LR'],
'C4MIP' : ['EC-EARTH-CC'],
'CDRMIP' : ['EC-EARTH-CC','EC-EARTH-Veg'],
'LUMIP' : ['EC-EARTH-CC','EC-EARTH-Veg'],
'OMIP' : ['EC-EARTH-CC'],
'C4MIP' : ['EC-EARTH-CC','EC-EARTH-ESM-1'],
'CDRMIP' : ['EC-EARTH-CC','EC-EARTH-ESM-1','EC-EARTH-Veg'],
'LUMIP' : ['EC-EARTH-CC','EC-EARTH-ESM-1','EC-EARTH-Veg'],
'OMIP' : ['EC-EARTH-CC','EC-EARTH-ESM-1'],
'ISMIP6' : ['EC-EARTH-GrisIS'],
'AerChemMIP' : ['EC-EARTH-AerChem']
}
Expand Down

0 comments on commit cec4bf9

Please sign in to comment.