diff --git a/data.md5 b/data.md5 index 6082204995d993381fe443793e9adc5c9a519ca4..017a0324ca4f60d65f68fc57001a44aef70caa4b 100644 --- a/data.md5 +++ b/data.md5 @@ -1,48 +1,88 @@ -033f343ce3a67f8bb501351f99a85317 data/areas-noamip.nc -e20bd335d965c010b675f20f81e0d46e data/grid-co2_emis.txt -3bbb8b30e6f607153b1f692f75f4c0e1 data/co2/CO2-em-AIR-anthro_input4MIPs_emissions_CMIP_CEDS-2017-08-30_gn_200001-201412.nc -2944ea34fc24351e917c4da477c954b0 data/co2/rmp_CO2_emis_to_B128_GAUSWGT_9.nc -bf613badddb00b8bb7a8ea4c701f54a7 data/co2/masks.nc -63bf264ef75413ebb365218130fd00c2 data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc -5f57096c16cc1a46e04e43a32c73c8ce data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-r1x2.nc -7f8ee4bf120727cfff1045aa1fc9533c data/co2/grids.nc -093662070c6903f56b82ce5240bf67cf data/co2/areas.nc -c0fd8ffdd070907b2c969c8bf36f0d25 data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc -2c57c30f97f9540f6ea8f7d0f7384ed6 data/co2/co2-area.nc -11b7cf6371d0de75bad15aed846b03e8 data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc.mod -a6410320ce2ec894d788c93ef07a4e99 data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-global.nc.1 -270e2062aa3fa40014c2a79f9e46dd13 data/co2/rmp_AMIP_to_L128_GAUSWGT_9.nc -c0fd8ffdd070907b2c969c8bf36f0d25 data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc.bak -89f40993d927d188692df6fb621450bf data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-global.nc -2a6ace582904da9db74c0de7d9fbfbeb data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412.nc -90a2c7aac4c2084f7d665bae3ccb842f data/ece3-toy-model/rmp_O1t0_to_L128_GAUSWGT_9.nc -433d647d7a5e963ccf63797ee2fbf911 data/ece3-toy-model/masks.nc -234ac42fa5d5cd076c2e7f4ab37b577b data/ece3-toy-model/rmp_A128_to_O1t0_GAUSWGT_9.nc -b4cf799ea4e4a141d127cc033572648d data/ece3-toy-model/grids.nc -76877af296ecf92f6a5115d2024d9278 data/ece3-toy-model/areas.nc -670f63a39e8a56b7eec8a919f478d5d2 data/ece3-toy-model/rmp_R128_to_RnfA_GAUSWGT_9.nc -02645b463f3a65a929c408c3b8c478e9 data/ece3-toy-model/rmp_A128_to_O1v0_GAUSWGT_9.nc -f8d27ddaa19cf744ab21e313a24c41e4 data/ece3-toy-model/grid-runoff.txt -16dbe2fa3832ff2927117d05b80ad593 data/ece3-toy-model/rmp_RnfO_to_O1t0_GAUSWGT_9.nc -8324c68639fb9547509a92674fdeebcb data/ece3-toy-model/rmp_A128_to_O1u0_GAUSWGT_9.nc -c2841c4f4097f1e8222ff06ddc22cb8d data/ece3-toy-model/rstas.nc -0eacc528218b23b7cfc7f88f05e7d474 data/ece3-toy-model/rstos.nc -f8f32e94f5844e28dcac542d3037f7c7 data/grid-amip.txt -2b7ad9915a0ea47be23d4f2499ac8a39 data/ICMGGa22e+000000 -eb2ddf1dd805be45c83da44316292843 data/forcing/AMIP/masks.nc -0715a0b90cab18235a17b48f1dcfee8b data/forcing/AMIP/grids.nc -3b0a69e73f3c655745df83b9e6763365 data/forcing/AMIP/areas.nc -2b01f60712a7de76ddad74edf0ca2fcc data/forcing/noamip/areas-noamip.nc -962d938652e10c82cf2c4fefb9875039 data/forcing/noamip/masks-noamip.nc -7763084bc6027f84f1d13b04c3b76ef1 data/forcing/noamip/grids-noamip.nc -c083451e0eb8a591b65b8d32c7ef9284 data/forcing/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc -eb2ddf1dd805be45c83da44316292843 data/forcing/masks.nc -080e5320ad6cdf2d29710d3091376dac data/forcing/amip-area.nc -0715a0b90cab18235a17b48f1dcfee8b data/forcing/grids.nc -3b0a69e73f3c655745df83b9e6763365 data/forcing/areas.nc -370bcbfaec69f457ec53401fba125e27 data/forcing/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc -270e2062aa3fa40014c2a79f9e46dd13 data/forcing/rmp_AMIP_to_L128_GAUSWGT_9.nc -95ce78c393b419557a04906554700ecc data/forcing/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-0_gs1x1_187001-201512.nc -9435d96e3e2f55caa762defbaf630e71 data/forcing/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-0_gs1x1_187001-201512.nc -f925f778f5cb615cef0856ea4797389a data/masks-noamip.nc -ac6a81c53dd07dfe45c5b399a66de34c data/grids-noamip.nc +033f343ce3a67f8bb501351f99a85317 ./data/areas-noamip.nc +b1a58ea43e67034d6dd50f0afc1aa6f9 ./data/grid-REG_1X1.txt +e20bd335d965c010b675f20f81e0d46e ./data/grid-co2_emis.txt +3bbb8b30e6f607153b1f692f75f4c0e1 ./data/co2/CO2-em-AIR-anthro_input4MIPs_emissions_CMIP_CEDS-2017-08-30_gn_200001-201412.nc +2944ea34fc24351e917c4da477c954b0 ./data/co2/rmp_CO2_emis_to_B128_GAUSWGT_9.nc +9408d2599eddc5fcc6ce45fdff516fea ./data/co2/rmp_REG_1X1_to_B128_GAUSWGT_9.nc +bf613badddb00b8bb7a8ea4c701f54a7 ./data/co2/masks.nc +dc20bf8d42385ad3d9d29541d1bda510 ./data/co2/rmp_CEDS_to_R128_GAUSWGT_9.nc +63bf264ef75413ebb365218130fd00c2 ./data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_0000-2014.nc +5f57096c16cc1a46e04e43a32c73c8ce ./data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-r1x2.nc +a25d42454c58d07c754c46cd53d00e44 ./data/co2/rmp_REG_1X1_to_R128_GAUSWGT_9.nc +7f8ee4bf120727cfff1045aa1fc9533c ./data/co2/grids.nc +093662070c6903f56b82ce5240bf67cf ./data/co2/areas.nc +66348ca71710468f18ca2413f2195a58 ./data/co2/oc_v2021_daily_mol_s_m2_2014.mod.nc +271bb575f1476799f0142d8d85fadede ./data/co2/SiB4v2_BioFluxes_v246_1x1_2014_day.nc +717c7c8b58dee3706ba50d199c751a71 ./data/co2/rmp_REG_1X1_to_A128_GAUSWGT_9.nc +3779986d32b0fce5c67b9c8bd63e493f ./data/co2/rmp_CEDS_to_A128_GAUSWGT_9.nc +c0fd8ffdd070907b2c969c8bf36f0d25 ./data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc +2c57c30f97f9540f6ea8f7d0f7384ed6 ./data/co2/co2-area.nc +11b7cf6371d0de75bad15aed846b03e8 ./data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc.mod +a6410320ce2ec894d788c93ef07a4e99 ./data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-global.nc.1 +71cfc442c1568cc917895b1976c17e74 ./data/co2/carbon_tracker/ocean/oc_v2021_monthly_mol_s_m2_2014.nc +33db8e3669581863e7f86db740d2abd4 ./data/co2/carbon_tracker/fossil/GCP_Global_1x1_2014.nc +ba0496ecf1c96d246e9449f002e5ef7e ./data/co2/carbon_tracker/fire/gfas_1x1_201408.nc +94beaeadfc3278f983e9f38d88627f78 ./data/co2/carbon_tracker/fire/gfas_1x1_201412.nc +44411fe3797af87062f87e38f58fd6b2 ./data/co2/carbon_tracker/fire/gfas_1x1_201402.nc +7b9be5b9df480bb767275659dd2df461 ./data/co2/carbon_tracker/fire/gfas_1x1_201407.nc +15fd760ac5f063540b8ff25fde9c2187 ./data/co2/carbon_tracker/fire/gfas_1x1_201403.nc +95e99c05bab291f7ae5b729fe021428d ./data/co2/carbon_tracker/fire/gfas_1x1_201404.nc +8b538ca5ac63767666e407b85b9a2f9a ./data/co2/carbon_tracker/fire/gfas_1x1_201406.nc +4db2c90c9cf74ba6e421f06b17309ee8 ./data/co2/carbon_tracker/fire/gfas_1x1_201410.nc +4f8a9c9970ed5e0bedba4c581d8ceb82 ./data/co2/carbon_tracker/fire/gfas_1x1_201409.nc +b858ef5fc5b07bbb31ec7221fb51ff04 ./data/co2/carbon_tracker/fire/gfas_1x1_201401.nc +73fcb152bab03195fd333e675963b02a ./data/co2/carbon_tracker/fire/gfas_1x1_201411.nc +e6dd347f2f26c888888e95e12a38a4cc ./data/co2/carbon_tracker/fire/gfas_1x1_201405.nc +6bd50f126053158481af5bde8f95e193 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201405.nc +1127a1e02d1b6cc9961d8cb389322461 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201406.nc +cda817bbcc0caf9f03425ae31caf3229 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201410.nc +c1cb293318db94d71a55f46beeada4b6 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201411.nc +47cf1f1fd4edb7660a94b18ec801cfbe ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201412.nc +eb0b942352c89af4a651b20725fe53a6 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201408.nc +5554c846d4fe98ab4592d6f15263d83c ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201404.nc +76e05f445ba087a7aa733bc7d462d1e3 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201402.nc +b411d0222faef18f8ca08c73a271c85a ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201401.nc +49bc2e1a9a0f28e992572e743cddcfce ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201403.nc +9df706a64a99602a7085d0367c85091a ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201407.nc +265354803f13fd3c48a8f3ae30af2da6 ./data/co2/carbon_tracker/bio/SiB4v2_BioFluxes_v246_1x1_201409.nc +71cfc442c1568cc917895b1976c17e74 ./data/co2/oc_v2021_monthly_mol_s_m2_2014.nc +270e2062aa3fa40014c2a79f9e46dd13 ./data/co2/rmp_AMIP_to_L128_GAUSWGT_9.nc +c0fd8ffdd070907b2c969c8bf36f0d25 ./data/co2/mole-fraction-of-carbon-dioxide-in-air_input4MIPs_GHGConcentrations_CMIP_UoM-CMIP-1-2-0_gr1-GMNHSH_184901-201412.nc.bak +dac881b284d9541c9159042decbf2e9d ./data/co2/rmp_CEDS_to_B128_GAUSWGT_9.nc +eaac40a9e26c4683fd1ae68f832facd1 ./data/co2/gfas_1x1_2014.nc +08acf824d0d5dde3dc18007344df6a57 ./data/co2/oc_v2021_monthly_mol_s_m2_2014.mod.nc +89f40993d927d188692df6fb621450bf ./data/co2/CO2-em-anthro_input4MIPs_emissions_CMIP_CEDS-2017-05-18_gn_200001-201412-global.nc +b7333ea2347c972c82127f5884be9cd1 ./data/co2/GCP_Global_1x1_2014.mod.nc +fa11cd870cca11cfddd8250fc8bf8d5f ./data/grid-CEDS.txt +90a2c7aac4c2084f7d665bae3ccb842f ./data/ece3-toy-model/rmp_O1t0_to_L128_GAUSWGT_9.nc +433d647d7a5e963ccf63797ee2fbf911 ./data/ece3-toy-model/masks.nc +234ac42fa5d5cd076c2e7f4ab37b577b ./data/ece3-toy-model/rmp_A128_to_O1t0_GAUSWGT_9.nc +b4cf799ea4e4a141d127cc033572648d ./data/ece3-toy-model/grids.nc +76877af296ecf92f6a5115d2024d9278 ./data/ece3-toy-model/areas.nc +670f63a39e8a56b7eec8a919f478d5d2 ./data/ece3-toy-model/rmp_R128_to_RnfA_GAUSWGT_9.nc +02645b463f3a65a929c408c3b8c478e9 ./data/ece3-toy-model/rmp_A128_to_O1v0_GAUSWGT_9.nc +f8d27ddaa19cf744ab21e313a24c41e4 ./data/ece3-toy-model/grid-runoff.txt +16dbe2fa3832ff2927117d05b80ad593 ./data/ece3-toy-model/rmp_RnfO_to_O1t0_GAUSWGT_9.nc +8324c68639fb9547509a92674fdeebcb ./data/ece3-toy-model/rmp_A128_to_O1u0_GAUSWGT_9.nc +c2841c4f4097f1e8222ff06ddc22cb8d ./data/ece3-toy-model/rstas.nc +0eacc528218b23b7cfc7f88f05e7d474 ./data/ece3-toy-model/rstos.nc +f8f32e94f5844e28dcac542d3037f7c7 ./data/grid-amip.txt +2b7ad9915a0ea47be23d4f2499ac8a39 ./data/ICMGGa22e+000000 +eb2ddf1dd805be45c83da44316292843 ./data/forcing/AMIP/masks.nc +0715a0b90cab18235a17b48f1dcfee8b ./data/forcing/AMIP/grids.nc +3b0a69e73f3c655745df83b9e6763365 ./data/forcing/AMIP/areas.nc +2b01f60712a7de76ddad74edf0ca2fcc ./data/forcing/noamip/areas-noamip.nc +962d938652e10c82cf2c4fefb9875039 ./data/forcing/noamip/masks-noamip.nc +7763084bc6027f84f1d13b04c3b76ef1 ./data/forcing/noamip/grids-noamip.nc +c083451e0eb8a591b65b8d32c7ef9284 ./data/forcing/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc +eb2ddf1dd805be45c83da44316292843 ./data/forcing/masks.nc +080e5320ad6cdf2d29710d3091376dac ./data/forcing/amip-area.nc +0715a0b90cab18235a17b48f1dcfee8b ./data/forcing/grids.nc +3b0a69e73f3c655745df83b9e6763365 ./data/forcing/areas.nc +370bcbfaec69f457ec53401fba125e27 ./data/forcing/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc +270e2062aa3fa40014c2a79f9e46dd13 ./data/forcing/rmp_AMIP_to_L128_GAUSWGT_9.nc +95ce78c393b419557a04906554700ecc ./data/forcing/tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-0_gs1x1_187001-201512.nc +9435d96e3e2f55caa762defbaf630e71 ./data/forcing/siconcbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-0_gs1x1_187001-201512.nc +f925f778f5cb615cef0856ea4797389a ./data/masks-noamip.nc +ac6a81c53dd07dfe45c5b399a66de34c ./data/grids-noamip.nc + diff --git a/scripts/convert-ece4pyreader-grids.sh b/scripts/convert-ece4pyreader-grids.sh index b3a979cd8066ee86cea903cf5e249374668e3ed1..c4f13c44dd732625967969f79593c3beed26aaff 100755 --- a/scripts/convert-ece4pyreader-grids.sh +++ b/scripts/convert-ece4pyreader-grids.sh @@ -2,11 +2,9 @@ set -xuve -#griddir=/gpfs/scratch/bsc32/bsc32051/pub/scripts/convert-tm5-grids griddir=. newdate=$1 -#taxis="settaxis,21450101,00:00:00,1day" taxis="settaxis,$newdate,00:00:00,1day" gridname_ifs=L128 @@ -14,14 +12,19 @@ griddef_ifs=ICMGGa22e+000000 # copy from /gpfs/scratch/bsc32/bsc32051/pub/script gridname_AMIP=AMIP griddef_amip=grid-amip.txt # cdo griddes tosbcs_input4MIPs_SSTsAndSeaIce_CMIP_PCMDI-AMIP-1-1-3_gn_187001-201706.nc > grid-amip.txt gridname_co2=CO2 -griddef_co2=grid-co2_emis.txt # cdo griddes > grid-co2_emis.txt +griddef_ceds=grid-CEDS.txt # cdo griddes > grid-CEDS.txt +griddef_carbon_tracker=grid-REG_1X1.txt # cdo griddes > grid-REG_1X1.txt model_ifs=IFS_TOY # set vars according to model_mode # TODO: They will be replaced by python YAML reader - +CO2FLUX=false +CO2FLUX_CEDS=false +CO2FLUX_CARBON_TRACKER=false +griddef_co2flux="" [ $model_mode = "co2box" ] && CO2BOX=true || CO2BOX=false -[ $model_mode = "co2flux" ] && CO2FLUX=true || CO2FLUX=false +[ $model_mode = "co2flux_ceds" ] && { CO2FLUX_CEDS=true; CO2FLUX=true; griddef_co2flux=${griddef_ceds}; } +[ $model_mode = "co2flux_carbon_tracker" ] && { CO2FLUX_CARBON_TRACKER=true; CO2FLUX=true; griddef_co2flux=${griddef_carbon_tracker}; } if [[ ${CO2BOX} == true ]] ; then grids="" @@ -29,18 +32,20 @@ if [[ ${CO2BOX} == true ]] ; then vars_ifs="" model_amip=CO2BOX model_co2=CO2BOX - vars_co2="" + vars_co2_co2flux="" 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" + grids="AMIP L128 B128" #A128 R128 + [[ ${CO2FLUX_CEDS} == true ]] && grids+=" CEDS" + [[ ${CO2FLUX_CARBON_TRACKER} == true ]] && grids+=" REG_1X1" 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" + [[ ${CO2FLUX} == true ]] && vars_ifs+=" A_CO2_emis A_CO2_veg A_CO2_fire A_CO2_oce" model_amip=AMIPFORC model_co2=AMIPFORC - [[ ${CO2FLUX} == true ]] && vars_co2="AMIP_CO2_emis" || vars_co2="" + [[ ${CO2FLUX} == true ]] && vars_co2_co2flux="AMIP_CO2_emis" || vars_co2_co2flux="" vars_co2_co2box="" vars_co2_ifs="" fi @@ -52,10 +57,14 @@ do format=nc suffix=".nc" griddef=${griddef_amip} - elif [[ ${gridname} == CO2_emis ]] ; then + elif [[ ${gridname} == CEDS ]] ; then + format=nc + suffix=".nc" + griddef=${griddef_ceds} + elif [[ ${gridname} == REG_1X1 ]] ; then format=nc suffix=".nc" - griddef=${griddef_co2} + griddef=${griddef_carbon_tracker} else format=grb1 suffix=".grb" @@ -82,10 +91,11 @@ do HDF5_DISABLE_VERSION_CHECK=1 cdo -O -f nc -r $taxis -setgrid,${griddir}/${griddef_amip} ${v}_${model_amip}_??.nc ${v}.nc done -for v in $vars_co2 +for v in $vars_co2_co2flux do - HDF5_DISABLE_VERSION_CHECK=1 cdo -O -f nc -r $taxis -setgrid,${griddir}/${griddef_co2} ${v}_${model_co2}_??.nc ${v}.nc + HDF5_DISABLE_VERSION_CHECK=1 cdo -O -f nc -r $taxis -setgrid,${griddir}/${griddef_co2flux} ${v}_${model_co2}_??.nc ${v}.nc done + for v in $vars_co2_co2box do HDF5_DISABLE_VERSION_CHECK=1 cdo -O -f nc -r $taxis ${v}_${model_co2}_??.nc ${v}.nc diff --git a/scripts/fix-gfas.sh b/scripts/fix-gfas.sh new file mode 100644 index 0000000000000000000000000000000000000000..14bbd66962658650b0600995f0b7457d3d2b28b2 --- /dev/null +++ b/scripts/fix-gfas.sh @@ -0,0 +1,18 @@ +set -xuve + +reftime="2000-01-01,00:00:00,days" + +rm -f tmp_*.nc + +for year in 2014 +do + for f in gfas_1x1_${year}??.nc + do + yyyy=${f:9:4} + mm=${f:13:2} + echo $f $yyyy $mm + cdo -r -O -setreftime,${reftime} -settaxis,${yyyy}-${mm}-01,00:00:00,1day $f tmp_${yyyy}${mm}.nc + done + + cdo -O -f nc4c -z zip_2 mergetime tmp_??????.nc gfas_1x1_${year}.nc +done diff --git a/scripts/fix-sib.sh b/scripts/fix-sib.sh new file mode 100644 index 0000000000000000000000000000000000000000..f88d34342cc8447f12d488012a2570226d6b0f73 --- /dev/null +++ b/scripts/fix-sib.sh @@ -0,0 +1,19 @@ +set -xuve + +reftime="2000-01-01,00:00:00,days" + +rm -f tmp_*.nc + +for year in 2014 +do + for f in SiB4v2_BioFluxes_v246_1x1_${year}??.nc + do + yyyy=${f:26:4} + mm=${f:30:2} + echo $f $yyyy $mm + cdo -r -O -setreftime,${reftime} -settaxis,${yyyy}-${mm}-01,00:00:00,3hour $f tmp_${yyyy}${mm}.nc + done + + cdo -O -f nc4c -z zip_2 mergetime tmp_??????.nc SiB4v2_BioFluxes_v246_1x1_2014_3hour.nc + cdo -O settime,00:00:00 -daymean SiB4v2_BioFluxes_v246_1x1_2014_3hour.nc SiB4v2_BioFluxes_v246_1x1_2014_day.nc +done diff --git a/scripts/launch_ece3_data_coupler_hpc2020.cmd b/scripts/launch_ece3_data_coupler_hpc2020.cmd index 52c2b673dd45920c504cae453aebf7fb8d27ebcb..9057eb09f6e947b4eaae9b4cb2a1c5a89ac2f40a 100644 --- a/scripts/launch_ece3_data_coupler_hpc2020.cmd +++ b/scripts/launch_ece3_data_coupler_hpc2020.cmd @@ -14,8 +14,11 @@ source modules.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 +#AMIP Forcing + co2flux_ceds +#bash ./run_example.sh datacoupler co2flux_ceds 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux_ceds.yaml +#co2flux_carbon_tracker +bash ./run_example.sh datacoupler co2flux_carbon_tracker 1 2014-01-01 2014-02-01 0 128 true false template_conf_datacoupler_co2flux_carbon_tracker.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 + diff --git a/scripts/launch_ece3_data_coupler_mn4.cmd b/scripts/launch_ece3_data_coupler_mn4.cmd index 99e7fe61da07678760c1783e84c0daf7c2230f14..1b7ff26cdf67eb00d1bf71eb63c146511ddcba81 100644 --- a/scripts/launch_ece3_data_coupler_mn4.cmd +++ b/scripts/launch_ece3_data_coupler_mn4.cmd @@ -14,7 +14,11 @@ source modules.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 +#AMIP Forcing + co2flux_ceds +bash ./run_example.sh datacoupler co2flux_ceds 4 2005-01-01 2005-03-01 0 128 true false template_conf_datacoupler_co2flux_ceds.yaml +#co2flux_carbon_tracker +#bash ./run_example.sh datacoupler co2flux_carbon_tracker 1 2014-01-01 2014-02-01 0 128 true false template_conf_datacoupler_co2flux_carbon_tracker.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 + + diff --git a/scripts/modules.sh b/scripts/modules.sh index d089610ff034101d860411c3d54c68a1043137f6..40abad18b695cca8628e87426eb9df6b7382d741 100644 --- a/scripts/modules.sh +++ b/scripts/modules.sh @@ -1,7 +1,6 @@ #!/bin/bash - -if [ $BSC_MACHINE = mn4 ]; then +if [ "$BSC_MACHINE" = mn4 ]; then # Environment for MN4 module load python/3.6.1 module load netcdf/4.2 @@ -13,7 +12,7 @@ if [ $BSC_MACHINE = mn4 ]; then # setup pyOasis environment source ../sources/oasis3-mct/generated/python/init.sh -elif [ $ECPLATFORM = hpc2020 ]; then +elif [ "$ECPLATFORM" = hpc2020 ]; then # Environment for HPC2020 module reset #module load python3/3.8.8-01 prgenv/intel intel/2021.4.0 intel-mkl/19.0.5 hpcx-openmpi/2.9.0 hdf5-parallel/1.10.6 netcdf4-parallel/4.7.4 cdo @@ -31,4 +30,4 @@ else echo "Error: Platform is unkown, could not load required moduleds." exit 1 -fi \ No newline at end of file +fi diff --git a/scripts/run_example.sh b/scripts/run_example.sh index 9afa10e1ba9f197ea8a89d7dc3e99831f1b06840..01dc1f8c4a3aeb29b1620cc1912fb709b2b1973c 100755 --- a/scripts/run_example.sh +++ b/scripts/run_example.sh @@ -93,10 +93,16 @@ if [ $model=datacoupler ]; then ln -sf $datadir/forcing/tosbcs*.nc $rundir/. ln -sf $datadir/forcing/rmp_AMIP_to_L${ifs_grid}_GAUSWGT*.nc $rundir/. + # CO2BOX / CO2FLUX 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/. - ln -sf $datadir/co2/rmp_CO2_emis_to_B${ifs_grid}_GAUSWGT*.nc $rundir/. + ln -sf $datadir/co2/rmp_* $rundir/. + ln -sf $datadir/co2/oc_v2021_daily_mol_s_m2_2014.mod.nc $rundir/. + ln -sf $datadir/co2/SiB4v2_BioFluxes_v246_1x1_2014_day.nc $rundir/. + ln -sf $datadir/co2/GCP_Global_1x1_2014.mod.nc $rundir/. + ln -sf $datadir/co2/gfas_1x1_2014.nc $rundir/. + fi # Get grids and masks if [ $model = fortran ] || [ $model = pythoncompat ]; then @@ -169,6 +175,7 @@ fi # convert output . convert-ece4pyreader-grids.sh ${leg_start_date} + #echo $casename 'is executed or submitted to queue.' echo 'Results are found in rundir : '$rundir echo 'Run Example is successfully executed' diff --git a/scripts/template_conf_datacoupler_co2flux.yaml b/scripts/template_conf_datacoupler_co2flux.yaml deleted file mode 100755 index 995e8b06115adbfc8aae2b22ad5663ad5f6f9742..0000000000000000000000000000000000000000 --- a/scripts/template_conf_datacoupler_co2flux.yaml +++ /dev/null @@ -1,35 +0,0 @@ -cat << EOF -# YAML input file for DataCoupler, It will be ingested and turn to Experiment YAML file - -## Model Information -ModelNameSend : AMIPFORC -ModelNameReceive : IFS_TOY -LogFileName : amip.log - -## Run Information -RunLengthSec : ${leg_length_sec} -TimeStepSec : ${cpl_freq_amip_sec} -StartYear : ${leg_start_date_yyyymmdd:0:4} -StartMonth : ${leg_start_date_yyyymmdd:4:2} -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: 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 } - AMIP_sic : { send_id: AMIP_sic, receive_id: A_Ice_frac, send_grid_name: 'AMIP', receive_grid_name: L128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } - AMIP_CO2_emis : { send_id: AMIP_CO2_emis, receive_id: A_CO2_emis, send_grid_name: 'CO2_emis', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } - AMIP_CO2_land : { send_id: AMIP_CO2_land, receive_id: A_CO2_land, send_grid_name: 'CO2_emis', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } - AMIP_CO2_ocean : { send_id: AMIP_CO2_ocean, receive_id: A_CO2_ocean, send_grid_name: 'CO2_emis', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } - -LDebug : false -EOF - diff --git a/scripts/template_conf_datacoupler_co2flux_carbon_tracker.yaml b/scripts/template_conf_datacoupler_co2flux_carbon_tracker.yaml new file mode 100755 index 0000000000000000000000000000000000000000..927b541f2fe7dd1eda211c758a866482ae5aabe6 --- /dev/null +++ b/scripts/template_conf_datacoupler_co2flux_carbon_tracker.yaml @@ -0,0 +1,38 @@ +cat << EOF +# YAML input file for DataCoupler, It will be ingested and turn to Experiment YAML file + +## Model Information +ModelNameSend : AMIPFORC +ModelNameReceive : IFS_TOY +LogFileName : amip.log + +## Run Information +RunLengthSec : ${leg_length_sec} +TimeStepSec : ${cpl_freq_amip_sec} +StartYear : ${leg_start_date_yyyymmdd:0:4} +StartMonth : ${leg_start_date_yyyymmdd:4:2} +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_emis_GCP_monthly : { id : CO2_emis_GCP_monthly, grid_name: REG_1X1, oasis_name: AMIP_CO2_emis, file_pattern: GCP_Global_1x1_2014.mod.nc, netcdf_variable: fossilfuel_burning_carbon_flux, yref_min : 2000, yref_max: 2014, timestep: monthly, interpolate : false, scale_factor: co2_c_to_co2, offset: 0, min: , max: , update: true, accum: true} + CO2_veg_sib_daily: { id : CO2_veg_sib_daily, grid_name: REG_1X1, oasis_name: AMIP_CO2_veg, file_pattern: SiB4v2_BioFluxes_v246_1x1_2014_day.nc, netcdf_variable: nee, yref_min : 2000, yref_max: 2014, timestep: daily, interpolate : false, scale_factor: co2_mol_to_kg, offset: 0, min: , max: , update: true, accum: true} + CO2_fire_gfas_daily: { id : CO2_fire_gfas_daily, grid_name: REG_1X1, oasis_name: AMIP_CO2_fire, file_pattern: gfas_1x1_2014.nc, netcdf_variable: co2fire, yref_min : 2000, yref_max: 2014, timestep: daily, interpolate : false, scale_factor: co2_mol_to_kg, offset: 0, min: , max: , update: true, accum: true} + CO2_oce_carboscope_daily: { id : CO2_oce_carboscope_daily, grid_name: REG_1X1, oasis_name: AMIP_CO2_oce, file_pattern: oc_v2021_daily_mol_s_m2_2014.mod.nc, netcdf_variable: co2flux_ocean, yref_min : 2000, yref_max: 2014, timestep: daily, interpolate : false, scale_factor: co2_mol_to_kg, 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 } + AMIP_sic : { send_id: AMIP_sic, receive_id: A_Ice_frac, send_grid_name: 'AMIP', receive_grid_name: L128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_emis : { send_id: AMIP_CO2_emis, receive_id: A_CO2_emis, send_grid_name: 'REG_1X1', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_veg : { send_id: AMIP_CO2_veg, receive_id: A_CO2_veg, send_grid_name: 'REG_1X1', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_fire : { send_id: AMIP_CO2_fire, receive_id: A_CO2_fire, send_grid_name: 'REG_1X1', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_oce : { send_id: AMIP_CO2_oce, receive_id: A_CO2_oce, send_grid_name: 'REG_1X1', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + +LDebug : false +EOF + diff --git a/scripts/template_conf_datacoupler_co2flux_ceds.yaml b/scripts/template_conf_datacoupler_co2flux_ceds.yaml new file mode 100755 index 0000000000000000000000000000000000000000..ab08c7663898e5fd4087ef132096ab0f66625ee3 --- /dev/null +++ b/scripts/template_conf_datacoupler_co2flux_ceds.yaml @@ -0,0 +1,37 @@ +cat << EOF +# YAML input file for DataCoupler, It will be ingested and turn to Experiment YAML file + +## Model Information +ModelNameSend : AMIPFORC +ModelNameReceive : IFS_TOY +LogFileName : amip.log + +## Run Information +RunLengthSec : ${leg_length_sec} +TimeStepSec : ${cpl_freq_amip_sec} +StartYear : ${leg_start_date_yyyymmdd:0:4} +StartMonth : ${leg_start_date_yyyymmdd:4:2} +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_emis_CEDS_monthly : { id : CO2_emis_CEDS_monthly, grid_name: CEDS, 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_veg_CEDS_monthly: { id : CO2_veg_CEDS_monthly, grid_name: CEDS, oasis_name: AMIP_CO2_veg, 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_fire_CEDS_monthly: { id : CO2_fire_CEDS_monthly, grid_name: CEDS, oasis_name: AMIP_CO2_fire, 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_oce_CEDS_monthly: { id : CO2_oce_CEDS_monthly, grid_name: CEDS, oasis_name: AMIP_CO2_oce, 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 } + AMIP_sic : { send_id: AMIP_sic, receive_id: A_Ice_frac, send_grid_name: 'AMIP', receive_grid_name: L128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_emis : { send_id: AMIP_CO2_emis, receive_id: A_CO2_emis, send_grid_name: 'CEDS', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_veg : { send_id: AMIP_CO2_veg, receive_id: A_CO2_veg, send_grid_name: 'CEDS', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_fire : { send_id: AMIP_CO2_fire, receive_id: A_CO2_fire, send_grid_name: 'CEDS', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + AMIP_CO2_oce : { send_id: AMIP_CO2_oce, receive_id: A_CO2_oce, send_grid_name: 'CEDS', receive_grid_name: B128, timestep: 'daily', scale_factor: 1, offset: 0, reset: true } + +LDebug : false +EOF + diff --git a/sources/data-coupler/DataCouplerOasisVar.py b/sources/data-coupler/DataCouplerOasisVar.py index 7b27d0be54b50cf83992b88e41c5036d61532ce6..b097a999d35b9951d74bd49134be1e5f7de39cb2 100644 --- a/sources/data-coupler/DataCouplerOasisVar.py +++ b/sources/data-coupler/DataCouplerOasisVar.py @@ -33,7 +33,7 @@ class OasisOutputVar: logging.debug('OasisOutputVar() conf={} reset={}'.format(str(self._conf),str(self._reset))) # reset if needed if self._reset: - self._send_field = 0. + self._send_field.fill(0.) logging.debug('reset field for var {} at time {}'.format(self._id,time)) # accumulate values from each fileIn_var linked to this oasisOut_var for (varname,fileIn_var) in self._fileIn_vars.items(): diff --git a/sources/data-coupler/DataCouplerUtils.py b/sources/data-coupler/DataCouplerUtils.py index bac601bcdde13a09a1a21a114283541c1579d423..3b7d67d105968b653502986bfc3a17f72da7b4ec 100644 --- a/sources/data-coupler/DataCouplerUtils.py +++ b/sources/data-coupler/DataCouplerUtils.py @@ -30,11 +30,16 @@ total_air_mass = 5.1480e18 # TODO add a global parameter to define this in case we use a global box model! #total_air_mass = 5.1480e18 / 2.0 +# TODO change this to a dict instead of function def scale_factor_from_str(scale_str): if scale_str == 'co2_mass_to_ppm': return 1 / 1e-6 / total_air_mass * fscale elif scale_str == 'co2_ppm_to_mass': return 1 * 1e-6 * total_air_mass / fscale + elif scale_str == 'co2_c_to_co2': + return xmco2 / xmc #44/12 + elif scale_str == 'co2_mol_to_kg': + return xmco2 / 1000. elif scale_str == 'second2day': return 24 * 60 * 60 else: