From 15197ca0c8e3ca06e92c18ada6350c43d3a93cf0 Mon Sep 17 00:00:00 2001 From: Amirpasha Mozaffari Date: Fri, 15 Sep 2023 10:15:56 +0200 Subject: [PATCH 1/4] bringing back missing var. names from grid convert and including forcing files into the run_dir --- tests/data/convert-ece4pyreader-grids.sh | 9 +++++++-- tests/data/template_conf_datacoupler_co2flux.yaml | 1 - tests/launch_ece3_data_coupler_mn4.cmd | 4 ++-- tests/run_example.sh | 4 ++++ 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/data/convert-ece4pyreader-grids.sh b/tests/data/convert-ece4pyreader-grids.sh index d7f61bc..40bc6be 100755 --- a/tests/data/convert-ece4pyreader-grids.sh +++ b/tests/data/convert-ece4pyreader-grids.sh @@ -47,14 +47,19 @@ do fi done +## TODO: They weill be replaced by python YAML reader +vars_ifs="A_SST A_Ice_frac" +[[ ${CO2FLUX} == true ]] && vars_ifs+=" A_CO2_emis A_CO2_land A_CO2_ocean" +vars_amip="AMIP_sst AMIP_sic" + vars_co2="" vars_co2_co2box="" vars_co2_ifs="" if [[ ${CO2BOX} == true ]]; then model_amip=CO2BOX model_co2=CO2BOX - [[ ${CO2_CMODE} == true ]] && vars_co2_co2box="CO2BOX_CO2_cconc CO2BOX_CO2_econc" - [[ ${CO2_CMODE} == true ]] && vars_co2_ifs="A_CO2_cconc A_CO2_econc" + [[ ${CO2BOX} == true ]] && vars_co2_co2box="CO2BOX_CO2_cconc CO2BOX_CO2_econc" + [[ ${CO2BOX} == true ]] && vars_co2_ifs="A_CO2_cconc A_CO2_econc" [[ ${CO2FLUX} == true ]] && vars_co2="CO2BOX_CO2_emis" else model_amip=AMIPFORC diff --git a/tests/data/template_conf_datacoupler_co2flux.yaml b/tests/data/template_conf_datacoupler_co2flux.yaml index dd29224..77947c6 100755 --- a/tests/data/template_conf_datacoupler_co2flux.yaml +++ b/tests/data/template_conf_datacoupler_co2flux.yaml @@ -6,7 +6,6 @@ cat << EOF ModelNameSend : AMIPFORC ModelNameReceive : IFS_TOY LogFileName : amip.log -YamlConfName : ${yaml_conf_file} ## Run Information RunLengthSec : ${leg_length_sec} diff --git a/tests/launch_ece3_data_coupler_mn4.cmd b/tests/launch_ece3_data_coupler_mn4.cmd index b5c4c4e..34bc933 100644 --- a/tests/launch_ece3_data_coupler_mn4.cmd +++ b/tests/launch_ece3_data_coupler_mn4.cmd @@ -39,9 +39,9 @@ source ../sources/oasis3-mct/generated/python/init.sh #bash ./run_example.sh co2box co2 4 2005-01-01 2005-03-01 0 128 true false #AMIP + Forcing -bash ./run_example.sh datacoupler forcing 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_forcing.yaml +#bash ./run_example.sh datacoupler forcing 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_forcing.yaml #AMIP + Forcing for co2flux -#bash ./run_example.sh datacoupler co2flux 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux.yaml +bash ./run_example.sh datacoupler co2flux 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux.yaml #bash ./run_example.sh python co2 4 2005-01-01 2005-03-01 0 128 true #bash ./run_example.sh co2box co2 4 2005-01-01 2005-03-01 0 128 true diff --git a/tests/run_example.sh b/tests/run_example.sh index b04c75d..fb0e5ab 100755 --- a/tests/run_example.sh +++ b/tests/run_example.sh @@ -92,6 +92,10 @@ elif [ $model_mode = primavera ]; then ln -sf $datadir/$model_mode/rmp_PSST_to_${ifs_grid}_GAUSWGT.nc $rundir/. fi if [ $model=datacoupler ]; then + ln -sf $datadir/forcing/siconcbcs*.nc $rundir/. + ln -sf $datadir/forcing/tosbcs*.nc $rundir/. + ln -sf $datadir/forcing/rmp_AMIP_to_L${ifs_grid}_GAUSWGT*.nc $rundir/. + ln -sf $datadir/co2/CO2-em-anthro_*.nc $rundir/. ln -sf $datadir/co2/CO2-em-AIR-anthro_*.nc $rundir/. ln -sf $datadir/co2/mole-fraction-of-carbon-dioxide-in-air_*.nc* $rundir/. -- GitLab From a69cf44e9164bff6b05ec62381fe878a032ee88f Mon Sep 17 00:00:00 2001 From: Etienne Tourigny Date: Fri, 15 Sep 2023 12:47:03 +0200 Subject: [PATCH 2/4] [co2flux] fix co2flux template --- tests/data/template_conf_datacoupler_co2flux.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/data/template_conf_datacoupler_co2flux.yaml b/tests/data/template_conf_datacoupler_co2flux.yaml index 77947c6..c0d818d 100755 --- a/tests/data/template_conf_datacoupler_co2flux.yaml +++ b/tests/data/template_conf_datacoupler_co2flux.yaml @@ -16,16 +16,13 @@ StartDay : ${leg_start_date_yyyymmdd:6:2} FixYear : ${ifs_cmip_fixyear} GridInfo : 88838 # number of grid cells : L080_NX = 35718 @ T159 resolution / L128_NX = 88838 @ T255 resolution / L256_NX = 348528 @ T511 resolution - - - ## Coupling Information FileInputVars: AMIP_sst_monthly : { id : AMIP_sst_monthly, grid_name: AMIP, oasis_name: AMIP_sst, file_pattern: tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc, netcdf_variable: tosbcs, yref_min : 1870, yref_max: 2016, timestep: monthly, interpolate : true, scale_factor: 1, offset: 273.15, min: 271.38, max: , update: true, accum: true} AMIP_sic_monthly : { id : AMIP_sic_monthly, grid_name: AMIP, oasis_name: AMIP_sic, file_pattern: siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc, netcdf_variable: siconcbcs, yref_min : 1870, yref_max: 2016, timestep: monthly, interpolate : true, scale_factor: 0.01, offset: 0, min: 0, max: 1, update: true, accum: true} - CO2_em_monthly : { id : CO2_em_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_emis, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 0.01, offset: 1, min: 0, max: , update: true, accum: true} - CO2_land_monthly: { id : CO2_land_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_land, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 0.01, offset: 0.5, min: 0, max: , update: true, accum: true} - CO2_ocean_monthly: { id : CO2_ocean_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_ocean, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 0.01, offset: 0.1, min: 0, max: , update: true, accum: true} + CO2_em_monthly : { id : CO2_em_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_emis, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 1, offset: 0, min: , max: , update: true, accum: true} + CO2_land_monthly: { id : CO2_land_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_land, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 0.5, offset: 0, min: , max: , update: true, accum: true} + CO2_ocean_monthly: { id : CO2_ocean_monthly, grid_name: CO2_emis, oasis_name: AMIP_CO2_ocean, file_pattern: CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc, netcdf_variable: CO2_em_anthro, yref_min : 1750, yref_max: 2018, timestep: monthly, interpolate : false, scale_factor: 0.1, offset: 0, min: , max: , update: true, accum: true} OasisOutputVars: AMIP_sst : { send_id: AMIP_sst, receive_id: A_SST, send_grid_name: 'AMIP', receive_grid_name: L128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } -- GitLab From 12cff9b20d2a4aaaf01cb11a3b09476213f48ff2 Mon Sep 17 00:00:00 2001 From: Etienne Tourigny Date: Fri, 15 Sep 2023 12:47:29 +0200 Subject: [PATCH 3/4] [co2flux] fix conversion script for co2box --- tests/data/convert-ece4pyreader-grids.sh | 48 +++++++++++++----------- tests/launch_ece3_data_coupler_mn4.cmd | 15 ++++---- tests/run_example.sh | 3 -- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/tests/data/convert-ece4pyreader-grids.sh b/tests/data/convert-ece4pyreader-grids.sh index 40bc6be..b3a979c 100755 --- a/tests/data/convert-ece4pyreader-grids.sh +++ b/tests/data/convert-ece4pyreader-grids.sh @@ -16,11 +16,34 @@ griddef_amip=grid-amip.txt # cdo griddes tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PC gridname_co2=CO2 griddef_co2=grid-co2_emis.txt # cdo griddes > grid-co2_emis.txt model_ifs=IFS_TOY -[$model_mode = "co2box" ] && CO2BOX=true || CO2BOX=false +# set vars according to model_mode +# TODO: They will be replaced by python YAML reader -grids="AMIP L128" #B128 A128 R128 -[[ ${CO2FLUX} == true ]] && grids+=" CO2_emis" +[ $model_mode = "co2box" ] && CO2BOX=true || CO2BOX=false +[ $model_mode = "co2flux" ] && CO2FLUX=true || CO2FLUX=false + +if [[ ${CO2BOX} == true ]] ; then + grids="" + vars_amip="" + vars_ifs="" + model_amip=CO2BOX + model_co2=CO2BOX + vars_co2="" + vars_co2_co2box="CO2BOX_CO2_cconc CO2BOX_CO2_econc" + vars_co2_ifs="A_CO2_cconc A_CO2_econc" +else + grids="AMIP L128" #B128 A128 R128 + [[ ${CO2FLUX} == true ]] && grids+=" CO2_emis" + vars_amip="AMIP_sst AMIP_sic" + vars_ifs="A_SST A_Ice_frac" + [[ ${CO2FLUX} == true ]] && vars_ifs+=" A_CO2_emis A_CO2_land A_CO2_ocean" + model_amip=AMIPFORC + model_co2=AMIPFORC + [[ ${CO2FLUX} == true ]] && vars_co2="AMIP_CO2_emis" || vars_co2="" + vars_co2_co2box="" + vars_co2_ifs="" +fi # copy from runtime dir the following files grids.nc areas.nc masks.nc for gridname in ${grids} @@ -47,25 +70,6 @@ do fi done -## TODO: They weill be replaced by python YAML reader -vars_ifs="A_SST A_Ice_frac" -[[ ${CO2FLUX} == true ]] && vars_ifs+=" A_CO2_emis A_CO2_land A_CO2_ocean" -vars_amip="AMIP_sst AMIP_sic" - -vars_co2="" -vars_co2_co2box="" -vars_co2_ifs="" -if [[ ${CO2BOX} == true ]]; then - model_amip=CO2BOX - model_co2=CO2BOX - [[ ${CO2BOX} == true ]] && vars_co2_co2box="CO2BOX_CO2_cconc CO2BOX_CO2_econc" - [[ ${CO2BOX} == true ]] && vars_co2_ifs="A_CO2_cconc A_CO2_econc" - [[ ${CO2FLUX} == true ]] && vars_co2="CO2BOX_CO2_emis" -else - model_amip=AMIPFORC - model_co2=AMIPFORC - [[ ${CO2FLUX} == true ]] && vars_co2="AMIP_CO2_emis" -fi for v in $vars_ifs do diff --git a/tests/launch_ece3_data_coupler_mn4.cmd b/tests/launch_ece3_data_coupler_mn4.cmd index 34bc933..771dccb 100644 --- a/tests/launch_ece3_data_coupler_mn4.cmd +++ b/tests/launch_ece3_data_coupler_mn4.cmd @@ -32,17 +32,18 @@ fi source ../sources/oasis3-mct/generated/python/init.sh +#AMIP Forcing only +#bash ./run_example.sh datacoupler forcing 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_forcing.yaml +#AMIP Forcing + co2flux +bash ./run_example.sh datacoupler co2flux 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux.yaml +#co2box only +#bash ./run_example.sh datacoupler co2box 1 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2box.yaml + +# old tests, TODO test them #bash ./run_example.sh pythoncompat forcing 4 2005-01-01 2005-03-01 0 128 true #bash ./run_example.sh fortran forcing 4 2005-01-01 2005-03-01 0 128 true #bash ./run_example-t1279.sh python forcing 4 2010-01-01 2010-03-01 0 128 true - #bash ./run_example.sh co2box co2 4 2005-01-01 2005-03-01 0 128 true false - -#AMIP + Forcing -#bash ./run_example.sh datacoupler forcing 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_forcing.yaml -#AMIP + Forcing for co2flux -bash ./run_example.sh datacoupler co2flux 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux.yaml - #bash ./run_example.sh python co2 4 2005-01-01 2005-03-01 0 128 true #bash ./run_example.sh co2box co2 4 2005-01-01 2005-03-01 0 128 true #bash ./run_example.sh co2box co2 4 2005-01-01 2005-03-01 0 128 true false diff --git a/tests/run_example.sh b/tests/run_example.sh index fb0e5ab..f88c4d1 100755 --- a/tests/run_example.sh +++ b/tests/run_example.sh @@ -56,9 +56,6 @@ else exit 1 fi -CO2_CMODE=false -CO2FLUX=false - # - Define rundir rundir=${srcdir}/work_${model}_${model_mode}_${nproc_exe1}_${leg_start_date}_${leg_end_date}_${ifs_cmip_fixyear}_${ifs_grid}_${amip_interpolate} -- GitLab From 8eec0900a3a88e8ebb72ec5cf5e4d2c13474ee6b Mon Sep 17 00:00:00 2001 From: Amirpasha Mozaffari Date: Fri, 15 Sep 2023 14:21:28 +0200 Subject: [PATCH 4/4] minor format chnage in YAML input files --- tests/data/template_conf_datacoupler_co2flux.yaml | 1 - tests/data/template_conf_datacoupler_forcing.yaml | 4 ---- 2 files changed, 5 deletions(-) diff --git a/tests/data/template_conf_datacoupler_co2flux.yaml b/tests/data/template_conf_datacoupler_co2flux.yaml index c0d818d..995e8b0 100755 --- a/tests/data/template_conf_datacoupler_co2flux.yaml +++ b/tests/data/template_conf_datacoupler_co2flux.yaml @@ -1,7 +1,6 @@ cat << EOF # YAML input file for DataCoupler, It will be ingested and turn to Experiment YAML file - ## Model Information ModelNameSend : AMIPFORC ModelNameReceive : IFS_TOY diff --git a/tests/data/template_conf_datacoupler_forcing.yaml b/tests/data/template_conf_datacoupler_forcing.yaml index 2e0ab98..a22dcc2 100755 --- a/tests/data/template_conf_datacoupler_forcing.yaml +++ b/tests/data/template_conf_datacoupler_forcing.yaml @@ -1,7 +1,6 @@ cat << EOF # YAML input file for DataCoupler, It will be ingested and turn to Experiment YAML file - ## Model Information ModelNameSend : AMIPFORC ModelNameReceive : IFS_TOY @@ -16,9 +15,6 @@ StartDay : ${leg_start_date_yyyymmdd:6:2} FixYear : ${ifs_cmip_fixyear} GridInfo : 88838 # number of grid cells : L080_NX = 35718 @ T159 resolution / L128_NX = 88838 @ T255 resolution / L256_NX = 348528 @ T511 resolution - - - ## Coupling Information FileInputVars: AMIP_sst_monthly : { id : AMIP_sst_monthly, grid_name: AMIP, oasis_name: AMIP_sst, file_pattern: tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc, netcdf_variable: tosbcs, yref_min : 1870, yref_max: 2016, timestep: monthly, interpolate : true, scale_factor: 1, offset: 273.15, min: 271.38, max: , update: true, accum: true} -- GitLab