diff --git a/cmor/mpiesm/scripts/ncatted_CS.sh b/cmor/mpiesm/scripts/ncatted_CS.sh index a4f327ad30d9ca20ce2220a8ea24210d6fb8f5e5..7d3422b440f3796aaba55b5a6b3e2da26c33ad38 100644 --- a/cmor/mpiesm/scripts/ncatted_CS.sh +++ b/cmor/mpiesm/scripts/ncatted_CS.sh @@ -6,14 +6,14 @@ module load nco # Attributes TITLE="MPI-ESM1-2-1 output prepared for PalMod2" -REFERENCES="The paper ist currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" #NOMINAL_RESOLUTION="500 km" # echam6, jsbach, mpiom, hamocc #NOMINAL_RESOLUTION="km" # vilma #NOMINAL_RESOLUTION="25 km" # mPISM -SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none\nland: JSBACH3.20\nlandIce: none/prescribed\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none/prescribed" +SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" CONVENTIONS="CF-1.7 PalMod-2.0" -CREATION_DATE="2024-09-20T18:00:00Z" -HISTORY="2024-09-20T18:00:00Z ; CMOR rewrote data to be consistent with PalMod2, CF-1.7 PalMod-2.0 and CF standards." +CREATION_DATE="2025-01-05T18:00:00Z" +HISTORY="2025-01-05T18:00:00Z ; CMOR rewrote data to be consistent with PalMod2, CF-1.7 PalMod-2.0 and CF standards." PARENTEXPID="no parent" declare -A TABLE_INFO # 00.00.02 @@ -25,27 +25,27 @@ declare -A TABLE_INFO #TABLE_INFO[fx]="Creation Date:(14 February 2022) MD5:26bac4b397da7babac4e36561826e6b0" #TABLE_INFO[Ofx]="Creation Date:(14 February 2022) MD5:26bac4b397da7babac4e36561826e6b0" # 00.00.03 -dreqversion="00.00.03" -TABLE_INFO[AERmon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Amon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[centennial]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[dec]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Emon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[EmonZ]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[fx]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IcenAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IcenGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IdecAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IdecGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IyrAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[IyrGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[LImon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Lmon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Odec]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Ofx]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Omon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[Oyr]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" -TABLE_INFO[SImon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#dreqversion="00.00.03" +#TABLE_INFO[AERmon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Amon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[centennial]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[dec]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Emon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[EmonZ]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[fx]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IcenAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IcenGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IdecAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IdecGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IyrAnt]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[IyrGre]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[LImon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Lmon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Odec]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Ofx]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Omon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[Oyr]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" +#TABLE_INFO[SImon]="Creation Date:(1 February 2023) MD5:437d9b7f4524e7483e04d57b09f4aaaa" # 00.00.04 dreqversion="00.00.04" TABLE_INFO[AERmon]="Creation Date:(18 September 2024) MD5:028d52f4a33ef4da346678b341512dda" @@ -71,8 +71,25 @@ TABLE_INFO[SImon]="Creation Date:(18 September 2024) MD5:028d52f4a33ef4da346678b TABLE_INFO[SLdec]="Creation Date:(18 September 2024) MD5:028d52f4a33ef4da346678b341512dda" #TABLE_INFO[]= declare -A VARIANT_INFO -VARIANT_INFO["4"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024). GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." +# !!!!!!! +# Beware: the variant_info does also vary with the forcing parameter and not only with the physics parameter! +# !!!!!!! +#p1f1 / pmo0007 VARIANT_INFO["1"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." +#p1f2 / pmo0012 +#VARIANT_INFO["1"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024)." +#p2f1 / pmo0009 +VARIANT_INFO["2"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but with increased vertical mixing in the ocean. For details see Mikoljawicz et al. (2024)." +#p3f1 / pmo0014 +VARIANT_INFO["3"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but with decreased vertical mixing in the ocean. For details see Mikoljawicz et al. (2024)." +#p4f2 / pmo0016 +VARIANT_INFO["4"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. Equivalent to p1 but with retuned atmosphere as well as modified sea-ice rigidity, ocean mixing, and basal sliding parameters. In addition, the simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024). GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." +#p5f2 / pmo0018 +VARIANT_INFO["5"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p4 but with the atmosphere tuning of p1. The simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024)." +#p6f2 / pmo0019 +VARIANT_INFO["6"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p4 but with brighter albedo parameters. The simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024)." +#p7f2 / pmo0020 +VARIANT_INFO["7"]="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p4 but with decreased basal sliding near the grounding line. The simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024)." echo "------------------------" echo $TITLE echo $REFERENCES @@ -84,7 +101,7 @@ echo $HISTORY echo ${TABLE_INFO[@]} echo "-------------------------" -exp_id=transient-deglaciation-interactive_r1i1p4f2-CR +exp_id=transient-deglaciation-interactive_r1i1p2f1-CR ifolder=/work/kd1292/ESGF_Buff/k204212/palmod_CS/${exp_id}/PalMod2/ @@ -108,6 +125,7 @@ echo $i $ifile #ncatted -O -h -a variant_info,global,m,c,"${VARIANT_INFO[$physics_index]}" $ifile || echo "ERROR $ifile" #ncatted -O -h -a tracking_id,global,m,c,"$uuid" $ifile || echo "ERROR $ifile" #ncatted -O -h -a parent_experiment_id,global,m,c,"${PARENTEXPID}" -a source,global,m,c,"$SOURCE" -a references,global,m,c,"$REFERENCES" -a variant_info,global,m,c,"${VARIANT_INFO[$physics_index]}" -a table_info,global,m,c,"${TABLE_INFO[$table]}" -a data_specs_version,global,m,c,${dreqversion} -a history,global,m,c,"$HISTORY" -a creation_date,global,m,c,"$CREATION_DATE" -a Conventions,global,m,c,"$CONVENTIONS" -a title,global,m,c,"$TITLE" -a tracking_id,global,m,c,"$uuid" $ifile || echo "ERROR $ifile" + #ncatted -O -h -a history,global,m,c,"$HISTORY" -a creation_date,global,m,c,"$CREATION_DATE" $ifile || echo "ERROR $ifile" # Adjust filename timestamp if [[ "$table" != *"fx"* ]]; then diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.cmor_ctl b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.cmor_ctl index 72de2fd768f2d848dc0483e430cb49a2bf34e9a3..580dc8e1328786cbe69d60ae19630bcc68795a7f 100755 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.cmor_ctl +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.cmor_ctl @@ -12,7 +12,7 @@ n_subsim=4 spinup=1000 iniyeararr=( $((4000+spinup)) 2000 2000 2000 ) finyeararr=( 8999 8999 8999 8999 ) -iniyearoffset=1000 +iniyearoffset=0 iniyear=$(( 1 + $iniyearoffset + $spinup )) finyear=$(( 26000 + $iniyearoffset - $spinup )) #offset compared to startyear @@ -27,7 +27,7 @@ inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10 # Chunksize # Note that there are prerequisites concerning the chunksize: # - the defined decadal timeslizes may not overlap between two chunks! -# - decadal bounds have to be defined accordingly - "???01231" in this case +# - decadal bounds have to be defined accordingly - "???01231" in this case # - usually this is the case by default due to decadal model output! chunksize=100 diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.runpp b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.runpp index 760bec8d8c4a048dab15c81274e68293096e354e..d379e12fd38600362d05a6ed7b4256fbce1679e2 100755 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.runpp +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR.runpp @@ -43,7 +43,7 @@ alias ncatted=/sw/spack-levante/nco-5.0.6-3xkdth/bin/ncatted ######################################### #Root directory of all scripts, outdata, logs etc -EXP_ID=transient-deglaciation-prescribed-glac1d_r1i1p1f1-CR +EXP_ID=transient-deglaciation-interactive_r1i1p1f1-CR #EXP_DIR_TRUNK=/work/bk1192/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p1f1-CR EXP_DIR_TRUNK=/work/kd1292/ESGF_Buff/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p1f1-CR @@ -135,7 +135,7 @@ ca+=([vilma]="${SCRIPT_ROOT}/cdocmorinfo_vilma_CR") experiment=transient-deglaciation-interactive member=r1i1p1f1 mip=PalMod2 -vd=v20240920 +vd=v20250105 #vd=v$(date '+%Y%m%d') #CMOR version directory name, should be a date in format YYYYMMDD #Where to store errors @@ -388,7 +388,7 @@ function run_agg fi # Perform aggregation for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) @@ -416,7 +416,7 @@ function run_agg sdir=${SDIR[$y]}/outdata/$submodel rawsdir=${RAWSDIR[$y]}/outdata/$submodel rawsdir_pism_ant=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_ANT - rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH + rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH echo "... writing output to $sdir/out_aggr" echo "... writing log to $errtemp_agg" @@ -478,7 +478,7 @@ function run_diag rm -f ${err}* # Perform diagnostic for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) @@ -585,7 +585,7 @@ function run_cmor rm -f ${err}* # Perform CMOR rewrite for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR_cdocmorinfo b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR_cdocmorinfo index 13092dd0c67cbb81589e3b438daa8ca376d0a01a..d005465835a5c895844a75c65ee9a833d5654182 100644 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR_cdocmorinfo +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f1-CR_cdocmorinfo @@ -19,7 +19,7 @@ FORCING_INDEX=1 VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." COMMENT="Earth viscosity configuration for the solid earth model VILMA. The vertical viscosity structure is piecewise constant for the following specified layers of the earth: (1) 0 to 3.480000e+06 m from earth core: 1.000000e+19 Pa s. (2) 3.480000e+06 to 5.701000e+06 m from earth core: 1.000000e+22 Pa s. (3) 5.701000e+06 to 6.291000e+06 m from earth core: 4.000000e+20 Pa s. (4) 6.291000e+06 to 6.371000e+06 m from earth core: 1.000000e+30 Pa s." ACTIVITY_ID=PalMod2 -#MIP_ERA=PalMod2 #ONLY CMIP6 +#MIP_ERA=PalMod2 #ONLY CMIP6 PROJECT_ID=PalMod2 REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" #FURTHER_INFO_URL="https://furtherinfo.es-doc.org/<mip_era>.<institution_id>.<source_id>.<experiment_id>.<sub_experiment_id>.<variant_label> @@ -28,7 +28,7 @@ REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" # else use BRANCH_DATES to give the dates in YYYYMMDD,YYYYMMDD format #BRANCH_TIME_IN_PARENT= #BRANCH_TIME_IN_CHILD= -#BRANCH_DATES=19000101,18500101 +#BRANCH_DATES=19000101,18500101 #BRANCH_METHOD="standard" #PARENT_MIP_ERA=none #ONLY CMIP6 #PARENT_ACTIVITY_ID=none @@ -45,7 +45,7 @@ SUB_EXPERIMENT=none # SOURCE_ID=MPI-ESM1-2-1-CR #MODEL_ID=MPI-ESM1-2-1-CR -REFERENCES="The paper ist currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" SOURCE_TYPE="AOGCM ISM SLM" #CALENDAR=proleptic_gregorian diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl new file mode 100755 index 0000000000000000000000000000000000000000..f7fe3b8df438bb627cef1eaea1d5ab9cd4201b93 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl @@ -0,0 +1,64 @@ +#! /bin/sh -e +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --time=48:00:00 +#SBATCH --partition=shared +#SBATCH --mail-type=FAIL +#SBATCH --output=%x_%j.log + +# Number of sub-simulations +n_subsim=4 +#initial and final year of the experiment +spinup=1000 +iniyeararr=( $((4000+spinup)) 2000 2000 2000 ) +finyeararr=( 8999 8999 8999 8949 ) +iniyearoffset=0 +iniyear=$(( 1 + $iniyearoffset + $spinup )) +finyear=$(( 25950 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) +# Time axis (26000-51 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 51 BP - 7000 yrs - 19001-25950 - 17001 + +# Chunksize +# Note that there are prerequisites concerning the chunksize: +# - the defined decadal timeslizes may not overlap between two chunks! +# - decadal bounds have to be defined accordingly - "???01231" in this case +# - usually this is the case by default due to decadal model output! +chunksize=100 + +# Create list +for i in $(seq 0 $(( n_subsim - 1 )) ) +do + for yyyy in $(seq ${iniyeararr[$i]} ${finyeararr[$i]} ) + do + paramarr+=( "$i $yyyy" ) + done +done + +rm -f cmor_ctl_list_interactive_synch_r1i1p1f2 +in=0 +for i in $(seq $((iniyear-iniyear)) $chunksize $((finyear-iniyear))) +do + [[ $i -eq $((iniyear-iniyear)) ]] && continue + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((i-1))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((i-1))]} | cut -d " " -f2) + in=$i + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p1f2 +done +[[ $i -ne $((finyear-iniyear)) ]] && { + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f2) + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p1f2 +} + +make -k -j 19 -f transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl.mk "$@" + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl.mk b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl.mk new file mode 100755 index 0000000000000000000000000000000000000000..b44c00657e252314f86b971b6f7a58558eb204f8 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.cmor_ctl.mk @@ -0,0 +1,44 @@ +EXP_ID = transient-deglaciation-interactive_r1i1p1f2-CR + +ACCOUNT = bm0021 +PARTITION = compute + +SUFFIX = +ARCHIVE_SUFFIX = + +TARGET_STEP=cmor +NUMCHUNKS=$(shell cat cmor_ctl_list_interactive_synch_r1i1p1f2 | wc -l ) + +AGGR_TIME = 00:30:00 +DIAGS_TIME = 01:00:00 +CMOR_TIME = 04:00:00 + +CMOR_FLAGS = + +SBATCHFLAGS=-W + +MESSAGE = $$(date +%Y-%m-%dT%H:%M:%S): CMIP6 diagnostics and CMOR rewriting ($(SUFFIX:_%=%)) + +.PHONY: all +.PRECIOUS: targets/$(EXP_ID).aggr$(SUFFIX).% targets/$(EXP_ID).diags$(SUFFIX).% targets/$(EXP_ID).cmor$(SUFFIX).% + + + +all: + @echo "$(MESSAGE) started" + mkdir -vp targets + $(MAKE) $(MFLAGS) -f $(MAKEFILE_LIST) $(addprefix targets/$(EXP_ID).$(TARGET_STEP)$(SUFFIX).,$(shell seq 1 $(NUMCHUNKS))) + @echo "$(MESSAGE) finished" + +targets/$(EXP_ID).aggr$(SUFFIX).%: + sbatch $(SBATCHFLAGS) --time=$(AGGR_TIME) --job-name=$(EXP_ID)_runpp_aggr$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -A $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p1f2) + @touch $@ + +targets/$(EXP_ID).diags$(SUFFIX).%: targets/$(EXP_ID).aggr$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(DIAGS_TIME) --job-name=$(EXP_ID)_runpp_diag$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -d $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p1f2) + @touch $@ + +targets/$(EXP_ID).cmor$(SUFFIX).%: targets/$(EXP_ID).diags$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(CMOR_TIME) --job-name=$(EXP_ID)_runpp_cmor$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -c $(CMOR_FLAGS) $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p1f2) + @touch $@ + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.runpp b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.runpp new file mode 100755 index 0000000000000000000000000000000000000000..afc3389bb0b7f41dec6325dccfea493ad0382ce2 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR.runpp @@ -0,0 +1,724 @@ +#!/bin/ksh +# +# PalMod .runpp +# +# Wrapper Script Agg+Diag+CMOR MPI-ESM1-2 by Martin Schupfner, DKRZ +# +### Batch Queuing System is SLURM +#SBATCH --partition=compute +#SBATCH --nodes=1 +#SBATCH --mem=100G +#SBATCH --time=01:30:00 +#SBATCH --mail-type=none +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --exclusive +#SBATCH --output=transient-deglaciation-interactive_r1i1p1f2-CR.runpp_%j.log + +DEBUG_LEVEL=${DEBUG_LEVEL:-0} + +# Support log style output +export LANG=C +print () { command print "$(date +'%F %T'):" "$@"; } +print_re='^[0-9]+-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}' + +warn () { print 'Hey:' "$@" >&2; } +die () { print 'Oops:' "$@" >&2; return 1; } + +# Bail out on error +trap 'print Error at line $LINENO >&2' ERR +set -eu + +# Disable core file creation +ulimit -c 0 + +# Print command info +[[ $DEBUG_LEVEL -ge 2 ]] && set -x + +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } +alias ncatted=/sw/spack-levante/nco-5.0.6-3xkdth/bin/ncatted + +######################################### +# Define specifics about the simulation +######################################### + +#Root directory of all scripts, outdata, logs etc +EXP_ID=transient-deglaciation-interactive_r1i1p1f2-CR +#EXP_DIR_TRUNK=/work/bk1192/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p1f2-CR +EXP_DIR_TRUNK=/work/kd1292/ESGF_Buff/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p1f2-CR + +#initial files for aggregation +INPUT_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous + +# RAW Data - path and sub-simulations +RAW_EXP_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous +# As usually the Experiment is composed of several sub-simulations, define them as array +RAW_EXP_IDS=( pmo0012a pmo0012b pmo0012c pmo0012d ) +# Parent experiment that the first RAW_EXP_ID branched from +# (used for input data of the parent that is required for aggregation) +# !! spinup - the aggregation will fail if the spinup period +# !! is as long or longer than +# !! the length of the first sub simulation! +spinup=1000 +RAW_EXP_ID_PARENT=( None pmo0012a pmo0012b pmo0012c ) # cmorizing 26000-51 BP as 1-25950 AD +if [[ $spinup -ne 0 ]]; then + RAW_EXP_ID_PARENT[0]=${RAW_EXP_IDS[0]} # cmorizing (26000-spinup)-51 BP as 1-(25950-spinup) AD +fi + +echo ${RAW_EXP_IDS[@]} +echo ${RAW_EXP_ID_PARENT[@]} + +#Work dir +WORK_DIR_TRUNK=$EXP_DIR_TRUNK/work + +#Where to find the scripts (runpp etc.) +SCRIPT_DIR=${EXP_DIR_TRUNK}/scripts +SCRIPT_DIR=/work/bm0021/PalMod2/cmor/mpiesm/scripts + + + +############################ +#Define necessary variables +############################ + +#Where to find cdo (incl. CMOR operator), eg.: +cdo="/work/bm0021/cdo_incl_cmor/cdo-2022-09-20_cmor3.6.0_gcc/bin/cdo -v" # surely working version +#cdo="/work/bm0021/cdo_incl_cmor/cdo-2024-09-11_cmor3.9.0_gcc/bin/cdo -v" # latest version +cdozg="/sw/spack-levante/cdo-1.9.10-j5frmz/bin/cdo -v" + +# Base directory for DataRequest related headers/scripts +SCRIPT_ROOT=${SCRIPT_DIR} + +#Where to find the functions +fpath=/work/bm0021/PalMod2/cmor/functions + +#Where to find the configuration +cpath=${SCRIPT_ROOT}/conf + +#Models +atmmod=echam6 +ocemod=mpiom +srfmod=jsbach +esmod=MPI-ESM1-2 +icemod=mpism +slmod=vilma + +#Chunks +chunks+=([echam6]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([jsbach]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([mpiom]=" 0 ") +chunks+=([jsbachdec]=" 0 ") +atmmod_dec_chunk="???0123124" +srfmod_dec_chunk="???0123124" +srfmod_input_dec_chunk="???0123124" +ocemod_dec_chunk="???1123124" +icemod_dec_chunk="???1123124" +slmod_dec_chunk="???1123124" +slmod_input_dec_chunk="???0123124" +ocemod_fxyear=3000 +chunks+=([mpism]=" 0 ") +chunks+=([vilma]=" 0 1 ") +chunks+=([vilmadec]=" 0 ") + +#InfoTable(s) +# Define here the "cdocmorinfo"-File or "eum"-Files +# Multiple files possible with "," as delimiter, eg: +# it=expinfo.txt,userinfo.txt,modelinfo.txt +it_temp="${SCRIPT_ROOT}/transient-deglaciation-interactive_r1i1p1f2-CR_cdocmorinfo" +ca+=([mpiom]="${SCRIPT_ROOT}/cdocmorinfo_mpiom_CR") +ca+=([echam6]="${SCRIPT_ROOT}/cdocmorinfo_echam6_CR") +ca+=([jsbach]="${SCRIPT_ROOT}/cdocmorinfo_jsbach_CR") +ca+=([mpism]="${SCRIPT_ROOT}/cdocmorinfo_mpism_CR") +ca+=([vilma]="${SCRIPT_ROOT}/cdocmorinfo_vilma_CR") + +#Experiment etc +experiment=transient-deglaciation-interactive +member=r1i1p1f2 +mip=PalMod2 +vd=v20250105 +#vd=v$(date '+%Y%m%d') #CMOR version directory name, should be a date in format YYYYMMDD + +#Where to store errors +errdir=${EXP_DIR_TRUNK}/logs/errors +errdir_cmor=${errdir}_cmor +errdir_diag=${errdir}_diag +errdir_agg=${errdir}_agg + +#initial and final year of the experiment +iniyeararr=($((4000+spinup)) 2000 2000 2000) # 26000-51 BP +finyeararr=(8999 8999 8999 8949) +iniyearoffset=0 # additional optional offset +iniyear=$(( $iniyearoffset + 1 )) +finyear=$(( 25950 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) # 26000-51 BP +# Time axis (26000-51 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 51 BP - 7000 yrs - 19001-25950 - 17001 + +#pmo0012a-d: Transient simulation of the last deglaciation with interactive ice +#sheets and synchronous coupling between MPI-ESM and the ice sheet-solid earth model. +#GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). +#They are structured as follows. +# +# pmo0012a: Simulation year 4000-8999 spans the time period 26000 +# years BP to 21000 years BP. +# pmo0012b: Simulation years 2000-8999; years 21000 to 14000 BP +# pmo0012c: Simulation years 2000-8999; years 14000 to 7000 BP +# pmo0012d: Simulation years 2000-8949; years 7000 BP to 50 BP +# + +# Command line options +RUN_AGG=true +RUN_DIAGS=true +RUN_CMOR=true +SUFFIX= +CLIMSUFFIX= +ARCHIVE_SUFFIX= +USE_CHUNKS=false +REMOVE_CHUNKS=false +PROCESS_CLIM=false +while [[ "$1" == -* ]] +do + OPT= + ARG= + case "$1" in + -d|--diags|--diags-only) RUN_CMOR=false; RUN_AGG=false;; + -c|--cmor|--cmor-only) RUN_DIAGS=false; RUN_AGG=false;; + -A|--agg|--agg-only) RUN_DIAGS=false; RUN_CMOR=false;; + -C|--clim) PROCESS_CLIM=true;; + -s|--suffix) OPT=-s; ARG=SUFFIX;; + -S|--archive-suffix) OPT=-S; ARG=ARCHIVE_SUFFIX;; + -f|--force) REMOVE_CHUNKS=true;; + -a|--append) USE_CHUNKS=true;; + --) shift; break;; + -*) die "invalid option '$1'";; + esac + if [[ -n "$OPT" ]] + then + shift + [[ $# -lt 1 ]] && die "missing argument for option '$OPT'" + eval "$ARG='$1'" + fi + shift +done + +echo "-----------------" +echo $0 $1 $2 $3 $4 +echo "-----------------" + +#Write Output to: +dr_trunk=${EXP_DIR_TRUNK}/archive$ARCHIVE_SUFFIX + + + +############################################################################### +# No user input beyond this line necessary (usually) +############################################################################### + +# Store parameters +par1=$1 +par2=$2 +par3=$3 +par4=$4 +n_arr=${#inioffsetarr[@]} + +#time interval of the experiment to standardize +if [[ ${#iniyeararr[@]} != ${#inioffsetarr[@]} ]] || [[ ${#iniyeararr[@]} != ${#finyeararr[@]} ]] || [[ ${#iniyeararr[@]} != ${#RAW_EXP_IDS[@]} ]]; then + die 'Each sub-simulation needs a specified iniyear, finyear and inioffset!' +else + for y in $(seq 0 $(( n_arr - 1 )) ); do + SDIR+=( ${EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + RAWSDIR+=( ${RAW_EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + WORK_DIR+=( ${WORK_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + done + [[ -z "$2" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$3" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$4" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + for y in $(seq 0 $(( n_arr - 1 )) ); do + if [[ $y -lt $par1 ]] || [[ $y -gt $par2 ]]; then + lrel=-1 + urel=-1 + labs=-1 + uabs=-1 + elif [[ $y -eq $1 ]] && [[ $1 -eq $2 ]]; then + lrel=$3 + urel=$4 + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $1 ]]; then + lrel=$3 + urel=${finyeararr[$y]} + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $2 ]]; then + lrel=${iniyeararr[$y]} + urel=$4 + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + else + lrel=${iniyeararr[$y]} + urel=${finyeararr[$y]} + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + fi + [[ $urel -lt $lrel ]] && die 'iniyear, finyear arrays not properly set up!' + [[ $uabs -lt $labs ]] && die 'iniyear, finyear arrays not properly set up!' + SUB_SIM_REL_L+=( $lrel ) + SUB_SIM_REL_U+=( $urel ) + SUB_SIM_ABS_L+=( $labs ) + SUB_SIM_ABS_U+=( $uabs ) + [[ $lrel -eq -1 ]] && continue + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_L[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_L[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_U[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_U[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + done + echo ${SUB_SIM_REL_L[@]} + echo ${SUB_SIM_REL_U[@]} + echo ${SUB_SIM_ABS_L[@]} + echo ${SUB_SIM_ABS_U[@]} + [[ $1 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $2 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $1 -gt $2 ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + cmorstart=$(( $3 + ${inioffsetarr[$1]} - $spinup )) + cmorend=$(( $4 + ${inioffsetarr[$2]} -spinup )) +fi +MESSAGE='PalMod2' +$RUN_AGG && MESSAGE+=' - Aggregation - ' +$RUN_DIAGS && MESSAGE+=' - Diagnostics - ' +$RUN_CMOR && MESSAGE+=" - CMOR rewriting - " +$PROCESS_CLIM && MESSAGE+=' for only climatological variables' +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE started for ${cmorstart}-${cmorend} $SUFFIX" +print " ... translating to ${RAW_EXP_IDS[$1]}@$3 to ${RAW_EXP_IDS[$2]}@$4" + +#exit 0 + + + +############################## +# Load the required functions +# function_Read_request_config: read data request / user configuration and initialize the if_requested check +# function_if_requested: checks if the currently processed variable is requested for the current timestep +# function_find_file: searches for inputfiles +############################## +. $fpath/function_Read_request_config_palmod +. $fpath/function_if_requested +. $fpath/function_find_file + +#Load predefined timeslices (depends on $iniyear/$finyear) +. $cpath/TimeSlices.h + +##Additionally define custom TimeSlices +## Example on how to define TimeSlices +## format: YYYYMMDDHH-YYYYMMDDHH +## +#TimeSlices+=([custom1]=(1850010100-1850010100)) +#TimeSlices+=([custom2]=(1850010100-1850123124)) +##TimeSlice dependend on variable +#TimeSlices+=([custom3]=(${iniyear}010100-${iniyear}123124)) +##TimeSlice dependend on arithmetics using variable +#TimeSlices+=([custom4]=($((iniyear+121))010100-$((iniyear+150))123124)) + +##Define SettingsContainer +## The following Option 3hrtest will activate the listed 3hr variables and deactivate any other variable for the given member (= realisation) +## The UserSettings for the given experiment have to contain the line: +## Option: 3hrtest = True +## or the setting will not be active! +#SettingsContainer+=([3hrtest]=([3hr]=(clt hfls hfss pr prc ps rlds rlus rsds rsus tas tos uas vas))) +#SettingsContainer[3hrtest]+=([${member}]=(${member}:False)) + +#Define Settings for Requested_vars.conf +ism=True # Produce PISM vars +slm=True # Produce vilma vars + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +rrc_option=-s +[[ $DEBUG_LEVEL -ge 1 ]] && rrc_option= +[[ $DEBUG_LEVEL -ge 2 ]] && rrc_option=-v +rrc_option=-v + + +################################# +# Run agg, diag and cmor-rewrite +################################# + +function run_agg +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_AGG; then + + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + period_bk=$period + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + print "Aggregation $chunk ($period): Reading forcing/input of year $inv_chunk_year (legacy) $period (latest)" + + # Clean up stdout/stderr from previous run of this script + errtemp_agg="${errdir_agg}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_agg} + err="${errtemp_agg}/err${period}" + rm -f ${err}* + + # Read input file + if [[ "${iniyeararr[$y]}" == "$period" ]] + then + echo "Reading from parent ${RAW_EXP_ID_PARENT[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/TOPO_$period.nc + else + echo "Reading from ${RAW_EXP_IDS[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/TOPO_$period.nc + fi + + # Perform aggregation for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform no time shift + cdochain="" + echo "--------- $period $period_bk $chunk" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment aggr/${RAW_EXP_IDS[$y]}/$submodel/$period + + # Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + rawsdir_pism_ant=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_ANT + rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH + echo "... writing output to $sdir/out_aggr" + echo "... writing log to $errtemp_agg" + + # Create output dirs + mkdir -p ${sdir}/tmp_aggr + mkdir -p ${sdir}/out_aggr + + # Create softlinks to raw model output - PISM requires special treatment + if [[ $submodel == "$icemod" ]]; then + #ln -sf $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + #ln -sf $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + cp -v $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + ncatted -O -h -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_ant_${period}.nc || { echo "ERROR ncatted $sdir/pism_ant_${period}.nc" ; exit 1 ; } + cp -v $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + ncatted -O -h -a ellipsoid,mapping,o,c,WGS84 -a grid_mapping_name,mapping,o,c,polar_stereographic -a false_easting,mapping,o,d,0. -a false_northing,mapping,o,d,0. -a latitude_of_projection_origin,mapping,o,d,90. -a standard_parallel,mapping,o,d,70. -a straight_vertical_longitude_from_pole,mapping,o,d,-45. -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_nh_${period}.nc || { echo "ERROR ncatted $sdir/pism_nh_${period}.nc" ; exit 1 ; } + elif [[ $submodel == "vilma" ]]; then + if [[ "${chunks[${submodel}dec]}" == *" ${period: -1} "* ]]; then + ln -vsf $rawsdir/vilma_-$(printf "%06d" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc || echo "ERROR ln -vsf $rawsdir/vilma_-$(printf \"%06d\" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc" + fi + else + ln -sf $rawsdir/*_${period}* $sdir/ 2>/dev/null 1>&2 || { echo "ERROR creating links for $period ${RAW_EXP_IDS[$y]} $submodel" && exit 1 ; } + fi + + # Load and run the aggr ScriptFragment + . ${SCRIPT_DIR}/palmod2_aggregation_${esmod}_${submodel}.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_AGG +} + +function run_diag +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_DIAGS; then + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Clean up stdout/stderr from previous run of this script + errtemp_diag="${errdir_diag}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_diag} + err="${errtemp_diag}/err${period}" + rm -f ${err}* + + # Perform diagnostic for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$period_bk + # create time-axis + cdochain="" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment diag/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $sdir/out_diag" + echo "... writing log to $errtemp_diag" + + # Diagnostic Output + mkdir -p ${sdir}/tmp_diag + mkdir -p ${sdir}/out_diag + + # Load and run the diag ScriptFragment + . ${SCRIPT_DIR}/palmod2_diagnostic_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_DIAG +} + +function run_cmor +{ + # Loop over file output periods and load CMOR-Rewrite script fragment + if $RUN_CMOR; then + + for y in $(seq ${par1} ${par2}); do + + # Use working directory to hold .CHUNK and other tmp files + current_dir=${WORK_DIR[$y]}/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + if [[ -e $current_dir ]] && [[ "$PROCESS_CLIM" == "false" ]] + then + if $USE_CHUNKS + then + warn "appending to existing chunk" + elif $REMOVE_CHUNKS + then + warn "moving chunk info to backup" + mkdir -p ${WORK_DIR[$y]}/backup + mv -v --backup=numbered $current_dir ${WORK_DIR[$y]}/backup + else + die "please check if cmor is running or has already been run for this chunk. Use --force to re-run" + fi + else + if $USE_CHUNKS + then + die "cannot find chunk info for appending" + fi + fi + mkdir -p $current_dir + previous_dir=$PWD + # Link gridinfo files + ln -sf $SCRIPT_DIR/gridinfo*nc $current_dir/ + cd $current_dir + + # Define DRS root dir + dr=$dr_trunk/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + mkdir -p $dr + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Define decadal interval + dioce="$(( ${period} + ${inioffsetarr[$y]} - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup + 9 ))" + disl=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + + # Clean up stdout/stderr from previous run of this script + errtemp_cmor="${errdir_cmor}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_cmor} + err="${errtemp_cmor}/err${period}" + rm -f ${err}* + + # Perform CMOR rewrite for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + di=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # create time-axis + cdochain="-shifttime,$((inioffsetarr[$y] - spinup -5 ))year -shifttime,-3day" + di="$(( ${period_bk} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period_bk} + ${inioffsetarr[$y]} - $spinup ))" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + di="$(( ${period} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup ))" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment cmor/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $dr/$submodel" + echo "... writing log to $errtemp_cmor" + + # Output + mkdir -p $dr/$submodel + + #Location of Mapping table: + mt="${SCRIPT_DIR}/tables/${esmod}_${submodel}_${mip}_mapping.txt" + + #Define cdocmorinfo + it="${it_temp},${ca[${submodel}]}" + + # Load and run the CMOR-Rewrite ScriptFragment + . ${SCRIPT_DIR}/palmod2_cmor-rewrite_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + cd $previous_dir + done # EXP ID Index y + + # Run NCO ncatted cleanup of unappropriate/unnecessary attributes + # this is necessary since CMOR sets attributes necessary only for CMIP6 + # that are unnecessary/wrong for PalMod + post_nco + + fi # if RUN_CMOR +} + +function post_nco { + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup started for $dr" +# Load nco +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } + +# Post Processing with ncatted +#Find netCDF files in DRS directory +flist=( $( find $dr -name "*.nc" -type f | sort ) ) + +#Loop and run ncatted +echo "-> Looping over ${#flist[@]} netCDF files!" +for f in ${flist[@]} +do + echo "... editing $f" + ncatted -O -h -a further_info_url,global,d,, $f && echo "... deleted 'further_info_url'." || echo "... failed (ERROR)" + [[ "$(basename $f)" == *"cen"* ]] && { + ncatted -O -h -a frequency,global,m,c,"cen" $f && echo "... changed frequency to 'cen'." || echo "... failed (ERROR)" + } +done + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup ended for $dr" + +} + + + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +# Thereafter run aggregation, diagnostic, cmorization +if $PROCESS_CLIM +then + # Overwrite cmorstart/cmorend: + cmorstart=$iniyear + cmorend=$finyear + + # Read settings for clim1 + CLIMSUFFIX=_clim + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + + if [[ "$experiment" != "ssp"* ]] + then + # Reset Read_requested_config + l_linu=0 + unset DreqSettings + unset SliceSettings + unset UserSettings + unset TimeSlicesBounds + unset PriorityOrder + + # Read settings for clim2 + CLIMSUFFIX=_clim2 + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + fi +else + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM$SUFFIX.conf || die "error while reading request config" + $RUN_AGG && run_agg || echo "Could not run agg" + $RUN_DIAGS && run_diag || echo "Could not run diag" + $RUN_CMOR && run_cmor || echo "Could not run cmor" + wait +fi + + + +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE finished for $cmorstart-$cmorend$SUFFIX" + +# Update run dates and submit job scripts + +# $Id$ + + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR_cdocmorinfo b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR_cdocmorinfo new file mode 100644 index 0000000000000000000000000000000000000000..e4a5b7c770ba3a58e0a6b588006db89a4da42138 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p1f2-CR_cdocmorinfo @@ -0,0 +1,113 @@ +# +# experiment info: +# +_CONTROLLED_VOCABULARY_FILE=PalMod2_CV.json +_FORMULA_VAR_FILE=PalMod2_formula_terms.json +_AXIS_ENTRY_FILE=PalMod2_coordinate.json +CONVENTIONS="CF-1.7 PalMod-2.0" +TITLE="MPI-ESM1-2-1 output prepared for PalMod2" +_history_template="%s ; CMOR rewrote data to be consistent with <activity_id>, <Conventions> and CF standards." + +EXPERIMENT_ID=transient-deglaciation-interactive +EXPERIMENT="synchronously coupled transient deglaciation with interactive ice sheets and solid earth" +#Specify VARIANT_LABEL explicitly or realization_index, physics_index, initialization_index and forcing_index: +VARIANT_LABEL=r1i1p1f2 +REALIZATION_INDEX=1 +INITIALIZATION_INDEX=1 +PHYSICS_INDEX=1 +FORCING_INDEX=2 +VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024)." +COMMENT="Earth viscosity configuration for the solid earth model VILMA. The vertical viscosity structure is piecewise constant for the following specified layers of the earth: (1) 0 to 3.480000e+06 m from earth core: 1.000000e+19 Pa s. (2) 3.480000e+06 to 5.701000e+06 m from earth core: 1.000000e+22 Pa s. (3) 5.701000e+06 to 6.291000e+06 m from earth core: 4.000000e+20 Pa s. (4) 6.291000e+06 to 6.371000e+06 m from earth core: 1.000000e+30 Pa s." +ACTIVITY_ID=PalMod2 +#MIP_ERA=PalMod2 #ONLY CMIP6 +PROJECT_ID=PalMod2 +REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" +#FURTHER_INFO_URL="https://furtherinfo.es-doc.org/<mip_era>.<institution_id>.<source_id>.<experiment_id>.<sub_experiment_id>.<variant_label> +#Branch Info: If needed use the following 2 attributes to define the branch time +# in Parent_Time_Units and Required_Time_Units (=child) +# else use BRANCH_DATES to give the dates in YYYYMMDD,YYYYMMDD format +#BRANCH_TIME_IN_PARENT= +#BRANCH_TIME_IN_CHILD= +#BRANCH_DATES=19000101,18500101 +#BRANCH_METHOD="standard" +#PARENT_MIP_ERA=none #ONLY CMIP6 +#PARENT_ACTIVITY_ID=none +#PARENT_EXPERIMENT=none +#cmip6-spinup-HR +#PARENT_EXPERIMENT_ID=none +#PARENT_SOURCE_ID=none +#PARENT_TIME_UNITS="days since 1850-1-1 00:00:00" +#PARENT_VARIANT_LABEL=none +SUB_EXPERIMENT_ID=none +SUB_EXPERIMENT=none +# +#model info: +# +SOURCE_ID=MPI-ESM1-2-1-CR +#MODEL_ID=MPI-ESM1-2-1-CR +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" +SOURCE_TYPE="AOGCM ISM SLM" +#CALENDAR=proleptic_gregorian +#MAPPING_TABLE_DIR=cmip6_mapping_tables +#MAPPING_TABLE=MPIESM1_CMIP6.txt +#GRID_FILE_DIR=__GRID_FILE_DIR +#GRID_FILE=__GRID_FILE +GRID=gn +GRID_LABEL=gn +#NOMINAL_RESOLUTION read from external file +#For MPIOM/HAMOCC CR / GR30 +#NOMINAL_RESOLUTION="500 km" +#For ECHAM6/JSBACH CR / T31 +#NOMINAL_RESOLUTION="500 km" +CHAR_AXIS_TYPELICE="ice_free_land","ice_sheet","floating_ice","ice_free_sea" +CHAR_AXIS_VEGTYPE=bare_land,glacier,tropical_evergreen_trees,tropical_deciduous_trees,extra-tropical_evergreen_trees,extra-tropical_deciduous_trees,raingreen_shrubs,deciduous_shrubs,C3_grass,C4_grass,C3_pasture,C4_pasture,C3_crops,C4_crops +CHAR_AXIS_SOILPOOLS=acid-soluble_below_ground_leaf_litter,acid-soluble_below_ground_woody_litter,water-soluble_below_ground_leaf_litter,water-soluble_below_ground_woody_litter,ethanol-soluble_below_ground_leaf_litter,ethanol-soluble_below_ground_woody_litter,non-soluble_below_ground_leaf_litter,non-soluble_below_ground_woody_litter,humus_from_leaf_litter,humus_from_woody_litter +CHAR_AXIS_LANDUSE=primary_and_secondary_land,crops,pastures,urban +CHAR_AXIS_BASIN=global_ocean,atlantic_arctic_ocean,indian_pacific_ocean +CHAR_AXIS_OLINE=barents_opening,bering_strait,canadian_archipelago,denmark_strait,drake_passage,english_channel,pacific_equatorial_undercurrent,faroe_scotland_channel,florida_bahamas_strait,fram_strait,iceland_faroe_channel,indonesian_throughflow,mozambique_channel,taiwan_luzon_straits,windward_passage +CHAR_AXIS_SILINE=barents_opening,bering_strait,canadian_archipelago,fram_strait +#spectband for the 3 aeropt variables +CHAR_AXIS_SPECTBAND_aeroptbnd=1818182 +CHAR_AXIS_SPECTBAND_aeroptbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aeroptbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerssabnd=1818182 +CHAR_AXIS_SPECTBAND_aerssabnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerssabnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerasymbnd=1818182 +CHAR_AXIS_SPECTBAND_aerasymbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerasymbnd_UNITS="m-1" +# 2d-spectband for the albedos +CHAR_AXIS_SPECTBAND_albdirbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdirbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdirbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_albdiffbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdiffbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdiffbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_solbnd=1818182 +CHAR_AXIS_SPECTBAND_solbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_solbnd_UNITS="m-1" +#T_AXIS="cmip" causes the time axis to be rewritten according to the requested time stamps +T_AXIS="cmip" +#OUTPUT_MODE="r" +OUTPUT_MODE="a" +MAX_SIZE=0 +SAVE_CHUNK="n" +#For files without time axis, if one is requested: +#firsttimeval=1 (1850-01-02 00:00:00 wenn days since 1850-01-01 00:00:00) +FIRSTTIMEVAL=1 +# +# institution and contact info: +# +# none of these can be set in the command line +# +DEFLATE_LEVEL=1 +CONTACT=palmod2-mpi-esm@dkrz.de +# +# MPI-M +# +INSTITUTION_ID=MPI-M +INSTITUTION="Max Planck Institute for Meteorology, Hamburg 20146, Germany" +LICENSE="PalMod2 model data produced by MPI-M is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law." +#MIP_TABLE_DIR="/pool/data/CMIP6/cmip6-cmor-tables/Tables/" +MIP_TABLE_DIR="/work/bm0021/PalMod2/cmor_tables/" diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl new file mode 100755 index 0000000000000000000000000000000000000000..b4b6776c765ee35b3f816054c72eba18e1641164 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl @@ -0,0 +1,64 @@ +#! /bin/sh -e +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --time=48:00:00 +#SBATCH --partition=shared +#SBATCH --mail-type=FAIL +#SBATCH --output=%x_%j.log + +# Number of sub-simulations +n_subsim=4 +#initial and final year of the experiment +spinup=1000 +iniyeararr=( $((4000+spinup)) 2000 2000 2000 ) +finyeararr=( 8999 8999 8999 8999 ) +iniyearoffset=0 +iniyear=$(( 1 + $iniyearoffset + $spinup )) +finyear=$(( 26000 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) +# Time axis (26000-1 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 1 BP - 7000 yrs - 19001-26000 - 17001 + +# Chunksize +# Note that there are prerequisites concerning the chunksize: +# - the defined decadal timeslizes may not overlap between two chunks! +# - decadal bounds have to be defined accordingly - "???01231" in this case +# - usually this is the case by default due to decadal model output! +chunksize=100 + +# Create list +for i in $(seq 0 $(( n_subsim - 1 )) ) +do + for yyyy in $(seq ${iniyeararr[$i]} ${finyeararr[$i]} ) + do + paramarr+=( "$i $yyyy" ) + done +done + +rm -f cmor_ctl_list_interactive_synch_r1i1p2f1 +in=0 +for i in $(seq $((iniyear-iniyear)) $chunksize $((finyear-iniyear))) +do + [[ $i -eq $((iniyear-iniyear)) ]] && continue + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((i-1))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((i-1))]} | cut -d " " -f2) + in=$i + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p2f1 +done +[[ $i -ne $((finyear-iniyear)) ]] && { + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f2) + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p2f1 +} + +make -k -j 19 -f transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl.mk "$@" + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl.mk b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl.mk new file mode 100755 index 0000000000000000000000000000000000000000..aae56e4688cc27a7d7b2962454ac69caaa90bb4c --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.cmor_ctl.mk @@ -0,0 +1,44 @@ +EXP_ID = transient-deglaciation-interactive_r1i1p2f1-CR + +ACCOUNT = bm0021 +PARTITION = compute + +SUFFIX = +ARCHIVE_SUFFIX = + +TARGET_STEP=cmor +NUMCHUNKS=$(shell cat cmor_ctl_list_interactive_synch_r1i1p2f1 | wc -l ) + +AGGR_TIME = 00:30:00 +DIAGS_TIME = 01:00:00 +CMOR_TIME = 04:00:00 + +CMOR_FLAGS = + +SBATCHFLAGS=-W + +MESSAGE = $$(date +%Y-%m-%dT%H:%M:%S): CMIP6 diagnostics and CMOR rewriting ($(SUFFIX:_%=%)) + +.PHONY: all +.PRECIOUS: targets/$(EXP_ID).aggr$(SUFFIX).% targets/$(EXP_ID).diags$(SUFFIX).% targets/$(EXP_ID).cmor$(SUFFIX).% + + + +all: + @echo "$(MESSAGE) started" + mkdir -vp targets + $(MAKE) $(MFLAGS) -f $(MAKEFILE_LIST) $(addprefix targets/$(EXP_ID).$(TARGET_STEP)$(SUFFIX).,$(shell seq 1 $(NUMCHUNKS))) + @echo "$(MESSAGE) finished" + +targets/$(EXP_ID).aggr$(SUFFIX).%: + sbatch $(SBATCHFLAGS) --time=$(AGGR_TIME) --job-name=$(EXP_ID)_runpp_aggr$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -A $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p2f1) + @touch $@ + +targets/$(EXP_ID).diags$(SUFFIX).%: targets/$(EXP_ID).aggr$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(DIAGS_TIME) --job-name=$(EXP_ID)_runpp_diag$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -d $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p2f1) + @touch $@ + +targets/$(EXP_ID).cmor$(SUFFIX).%: targets/$(EXP_ID).diags$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(CMOR_TIME) --job-name=$(EXP_ID)_runpp_cmor$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -c $(CMOR_FLAGS) $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p2f1) + @touch $@ + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.runpp b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.runpp new file mode 100755 index 0000000000000000000000000000000000000000..be2d0261d3e55f7b961a090af400c092383f8367 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR.runpp @@ -0,0 +1,724 @@ +#!/bin/ksh +# +# PalMod .runpp +# +# Wrapper Script Agg+Diag+CMOR MPI-ESM1-2 by Martin Schupfner, DKRZ +# +### Batch Queuing System is SLURM +#SBATCH --partition=compute +#SBATCH --nodes=1 +#SBATCH --mem=100G +#SBATCH --time=01:30:00 +#SBATCH --mail-type=none +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --exclusive +#SBATCH --output=transient-deglaciation-interactive_r1i1p2f1-CR.runpp_%j.log + +DEBUG_LEVEL=${DEBUG_LEVEL:-0} + +# Support log style output +export LANG=C +print () { command print "$(date +'%F %T'):" "$@"; } +print_re='^[0-9]+-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}' + +warn () { print 'Hey:' "$@" >&2; } +die () { print 'Oops:' "$@" >&2; return 1; } + +# Bail out on error +trap 'print Error at line $LINENO >&2' ERR +set -eu + +# Disable core file creation +ulimit -c 0 + +# Print command info +[[ $DEBUG_LEVEL -ge 2 ]] && set -x + +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } +alias ncatted=/sw/spack-levante/nco-5.0.6-3xkdth/bin/ncatted + +######################################### +# Define specifics about the simulation +######################################### + +#Root directory of all scripts, outdata, logs etc +EXP_ID=transient-deglaciation-interactive_r1i1p2f1-CR +#EXP_DIR_TRUNK=/work/bk1192/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p2f1-CR +EXP_DIR_TRUNK=/work/kd1292/ESGF_Buff/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p2f1-CR + +#initial files for aggregation +INPUT_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous + +# RAW Data - path and sub-simulations +RAW_EXP_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous +# As usually the Experiment is composed of several sub-simulations, define them as array +RAW_EXP_IDS=( pmo0009a pmo0009b pmo0009c pmo0009d ) +# Parent experiment that the first RAW_EXP_ID branched from +# (used for input data of the parent that is required for aggregation) +# !! spinup - the aggregation will fail if the spinup period +# !! is as long or longer than +# !! the length of the first sub simulation! +spinup=1000 +RAW_EXP_ID_PARENT=( None pmo0009a pmo0009b pmo0009c ) # cmorizing 26000-1 BP as 1-26000 AD +if [[ $spinup -ne 0 ]]; then + RAW_EXP_ID_PARENT[0]=${RAW_EXP_IDS[0]} # cmorizing (26000-spinup)-1 BP as 1-(26000-spinup) AD +fi + +echo ${RAW_EXP_IDS[@]} +echo ${RAW_EXP_ID_PARENT[@]} + +#Work dir +WORK_DIR_TRUNK=$EXP_DIR_TRUNK/work + +#Where to find the scripts (runpp etc.) +SCRIPT_DIR=${EXP_DIR_TRUNK}/scripts +SCRIPT_DIR=/work/bm0021/PalMod2/cmor/mpiesm/scripts + + + +############################ +#Define necessary variables +############################ + +#Where to find cdo (incl. CMOR operator), eg.: +cdo="/work/bm0021/cdo_incl_cmor/cdo-2022-09-20_cmor3.6.0_gcc/bin/cdo -v" # surely working version +#cdo="/work/bm0021/cdo_incl_cmor/cdo-2024-09-11_cmor3.9.0_gcc/bin/cdo -v" # latest version +cdozg="/sw/spack-levante/cdo-1.9.10-j5frmz/bin/cdo -v" + +# Base directory for DataRequest related headers/scripts +SCRIPT_ROOT=${SCRIPT_DIR} + +#Where to find the functions +fpath=/work/bm0021/PalMod2/cmor/functions + +#Where to find the configuration +cpath=${SCRIPT_ROOT}/conf + +#Models +atmmod=echam6 +ocemod=mpiom +srfmod=jsbach +esmod=MPI-ESM1-2 +icemod=mpism +slmod=vilma + +#Chunks +chunks+=([echam6]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([jsbach]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([mpiom]=" 0 ") +chunks+=([jsbachdec]=" 0 ") +atmmod_dec_chunk="???0123124" +srfmod_dec_chunk="???0123124" +srfmod_input_dec_chunk="???0123124" +ocemod_dec_chunk="???1123124" +icemod_dec_chunk="???1123124" +slmod_dec_chunk="???1123124" +slmod_input_dec_chunk="???0123124" +ocemod_fxyear=3000 +chunks+=([mpism]=" 0 ") +chunks+=([vilma]=" 0 1 ") +chunks+=([vilmadec]=" 0 ") + +#InfoTable(s) +# Define here the "cdocmorinfo"-File or "eum"-Files +# Multiple files possible with "," as delimiter, eg: +# it=expinfo.txt,userinfo.txt,modelinfo.txt +it_temp="${SCRIPT_ROOT}/transient-deglaciation-interactive_r1i1p2f1-CR_cdocmorinfo" +ca+=([mpiom]="${SCRIPT_ROOT}/cdocmorinfo_mpiom_CR") +ca+=([echam6]="${SCRIPT_ROOT}/cdocmorinfo_echam6_CR") +ca+=([jsbach]="${SCRIPT_ROOT}/cdocmorinfo_jsbach_CR") +ca+=([mpism]="${SCRIPT_ROOT}/cdocmorinfo_mpism_CR") +ca+=([vilma]="${SCRIPT_ROOT}/cdocmorinfo_vilma_CR") + +#Experiment etc +experiment=transient-deglaciation-interactive +member=r1i1p2f1 +mip=PalMod2 +vd=v20250105 +#vd=v$(date '+%Y%m%d') #CMOR version directory name, should be a date in format YYYYMMDD + +#Where to store errors +errdir=${EXP_DIR_TRUNK}/logs/errors +errdir_cmor=${errdir}_cmor +errdir_diag=${errdir}_diag +errdir_agg=${errdir}_agg + +#initial and final year of the experiment +iniyeararr=($((4000+spinup)) 2000 2000 2000) # 26000-1 BP +finyeararr=(8999 8999 8999 8999) +iniyearoffset=0 # additional optional offset +iniyear=$(( $iniyearoffset + 1 )) +finyear=$(( 26000 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) # 26000-1 BP +# Time axis (26000-1 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 1 BP - 7000 yrs - 19001-26000 - 17001 + +#pmo0009a-d: Transient simulation of the last deglaciation with interactive ice +#sheets and synchronous coupling between MPI-ESM and the ice sheet-solid earth model. +#GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). +#They are structured as follows. +# +# pmo0009a: Simulation year 4000-8999 spans the time period 26000 +# years BP to 21000 years BP. +# pmo0009b: Simulation years 2000-8999; years 21000 to 14000 BP +# pmo0009c: Simulation years 2000-8999; years 14000 to 7000 BP +# pmo0009d: Simulation years 2000-8999; years 7000 BP to 0 BP +# + +# Command line options +RUN_AGG=true +RUN_DIAGS=true +RUN_CMOR=true +SUFFIX= +CLIMSUFFIX= +ARCHIVE_SUFFIX= +USE_CHUNKS=false +REMOVE_CHUNKS=false +PROCESS_CLIM=false +while [[ "$1" == -* ]] +do + OPT= + ARG= + case "$1" in + -d|--diags|--diags-only) RUN_CMOR=false; RUN_AGG=false;; + -c|--cmor|--cmor-only) RUN_DIAGS=false; RUN_AGG=false;; + -A|--agg|--agg-only) RUN_DIAGS=false; RUN_CMOR=false;; + -C|--clim) PROCESS_CLIM=true;; + -s|--suffix) OPT=-s; ARG=SUFFIX;; + -S|--archive-suffix) OPT=-S; ARG=ARCHIVE_SUFFIX;; + -f|--force) REMOVE_CHUNKS=true;; + -a|--append) USE_CHUNKS=true;; + --) shift; break;; + -*) die "invalid option '$1'";; + esac + if [[ -n "$OPT" ]] + then + shift + [[ $# -lt 1 ]] && die "missing argument for option '$OPT'" + eval "$ARG='$1'" + fi + shift +done + +echo "-----------------" +echo $0 $1 $2 $3 $4 +echo "-----------------" + +#Write Output to: +dr_trunk=${EXP_DIR_TRUNK}/archive$ARCHIVE_SUFFIX + + + +############################################################################### +# No user input beyond this line necessary (usually) +############################################################################### + +# Store parameters +par1=$1 +par2=$2 +par3=$3 +par4=$4 +n_arr=${#inioffsetarr[@]} + +#time interval of the experiment to standardize +if [[ ${#iniyeararr[@]} != ${#inioffsetarr[@]} ]] || [[ ${#iniyeararr[@]} != ${#finyeararr[@]} ]] || [[ ${#iniyeararr[@]} != ${#RAW_EXP_IDS[@]} ]]; then + die 'Each sub-simulation needs a specified iniyear, finyear and inioffset!' +else + for y in $(seq 0 $(( n_arr - 1 )) ); do + SDIR+=( ${EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + RAWSDIR+=( ${RAW_EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + WORK_DIR+=( ${WORK_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + done + [[ -z "$2" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$3" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$4" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + for y in $(seq 0 $(( n_arr - 1 )) ); do + if [[ $y -lt $par1 ]] || [[ $y -gt $par2 ]]; then + lrel=-1 + urel=-1 + labs=-1 + uabs=-1 + elif [[ $y -eq $1 ]] && [[ $1 -eq $2 ]]; then + lrel=$3 + urel=$4 + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $1 ]]; then + lrel=$3 + urel=${finyeararr[$y]} + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $2 ]]; then + lrel=${iniyeararr[$y]} + urel=$4 + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + else + lrel=${iniyeararr[$y]} + urel=${finyeararr[$y]} + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + fi + [[ $urel -lt $lrel ]] && die 'iniyear, finyear arrays not properly set up!' + [[ $uabs -lt $labs ]] && die 'iniyear, finyear arrays not properly set up!' + SUB_SIM_REL_L+=( $lrel ) + SUB_SIM_REL_U+=( $urel ) + SUB_SIM_ABS_L+=( $labs ) + SUB_SIM_ABS_U+=( $uabs ) + [[ $lrel -eq -1 ]] && continue + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_L[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_L[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_U[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_U[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + done + echo ${SUB_SIM_REL_L[@]} + echo ${SUB_SIM_REL_U[@]} + echo ${SUB_SIM_ABS_L[@]} + echo ${SUB_SIM_ABS_U[@]} + [[ $1 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $2 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $1 -gt $2 ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + cmorstart=$(( $3 + ${inioffsetarr[$1]} - $spinup )) + cmorend=$(( $4 + ${inioffsetarr[$2]} -spinup )) +fi +MESSAGE='PalMod2' +$RUN_AGG && MESSAGE+=' - Aggregation - ' +$RUN_DIAGS && MESSAGE+=' - Diagnostics - ' +$RUN_CMOR && MESSAGE+=" - CMOR rewriting - " +$PROCESS_CLIM && MESSAGE+=' for only climatological variables' +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE started for ${cmorstart}-${cmorend} $SUFFIX" +print " ... translating to ${RAW_EXP_IDS[$1]}@$3 to ${RAW_EXP_IDS[$2]}@$4" + +#exit 0 + + + +############################## +# Load the required functions +# function_Read_request_config: read data request / user configuration and initialize the if_requested check +# function_if_requested: checks if the currently processed variable is requested for the current timestep +# function_find_file: searches for inputfiles +############################## +. $fpath/function_Read_request_config_palmod +. $fpath/function_if_requested +. $fpath/function_find_file + +#Load predefined timeslices (depends on $iniyear/$finyear) +. $cpath/TimeSlices.h + +##Additionally define custom TimeSlices +## Example on how to define TimeSlices +## format: YYYYMMDDHH-YYYYMMDDHH +## +#TimeSlices+=([custom1]=(1850010100-1850010100)) +#TimeSlices+=([custom2]=(1850010100-1850123124)) +##TimeSlice dependend on variable +#TimeSlices+=([custom3]=(${iniyear}010100-${iniyear}123124)) +##TimeSlice dependend on arithmetics using variable +#TimeSlices+=([custom4]=($((iniyear+121))010100-$((iniyear+150))123124)) + +##Define SettingsContainer +## The following Option 3hrtest will activate the listed 3hr variables and deactivate any other variable for the given member (= realisation) +## The UserSettings for the given experiment have to contain the line: +## Option: 3hrtest = True +## or the setting will not be active! +#SettingsContainer+=([3hrtest]=([3hr]=(clt hfls hfss pr prc ps rlds rlus rsds rsus tas tos uas vas))) +#SettingsContainer[3hrtest]+=([${member}]=(${member}:False)) + +#Define Settings for Requested_vars.conf +ism=True # Produce PISM vars +slm=True # Produce vilma vars + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +rrc_option=-s +[[ $DEBUG_LEVEL -ge 1 ]] && rrc_option= +[[ $DEBUG_LEVEL -ge 2 ]] && rrc_option=-v +rrc_option=-v + + +################################# +# Run agg, diag and cmor-rewrite +################################# + +function run_agg +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_AGG; then + + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + period_bk=$period + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + print "Aggregation $chunk ($period): Reading forcing/input of year $inv_chunk_year (legacy) $period (latest)" + + # Clean up stdout/stderr from previous run of this script + errtemp_agg="${errdir_agg}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_agg} + err="${errtemp_agg}/err${period}" + rm -f ${err}* + + # Read input file + if [[ "${iniyeararr[$y]}" == "$period" ]] + then + echo "Reading from parent ${RAW_EXP_ID_PARENT[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/TOPO_$period.nc + else + echo "Reading from ${RAW_EXP_IDS[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/TOPO_$period.nc + fi + + # Perform aggregation for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform no time shift + cdochain="" + echo "--------- $period $period_bk $chunk" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment aggr/${RAW_EXP_IDS[$y]}/$submodel/$period + + # Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + rawsdir_pism_ant=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_ANT + rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH + echo "... writing output to $sdir/out_aggr" + echo "... writing log to $errtemp_agg" + + # Create output dirs + mkdir -p ${sdir}/tmp_aggr + mkdir -p ${sdir}/out_aggr + + # Create softlinks to raw model output - PISM requires special treatment + if [[ $submodel == "$icemod" ]]; then + #ln -sf $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + #ln -sf $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + cp -v $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + ncatted -O -h -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_ant_${period}.nc || { echo "ERROR ncatted $sdir/pism_ant_${period}.nc" ; exit 1 ; } + cp -v $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + ncatted -O -h -a ellipsoid,mapping,o,c,WGS84 -a grid_mapping_name,mapping,o,c,polar_stereographic -a false_easting,mapping,o,d,0. -a false_northing,mapping,o,d,0. -a latitude_of_projection_origin,mapping,o,d,90. -a standard_parallel,mapping,o,d,70. -a straight_vertical_longitude_from_pole,mapping,o,d,-45. -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_nh_${period}.nc || { echo "ERROR ncatted $sdir/pism_nh_${period}.nc" ; exit 1 ; } + elif [[ $submodel == "vilma" ]]; then + if [[ "${chunks[${submodel}dec]}" == *" ${period: -1} "* ]]; then + ln -vsf $rawsdir/vilma_-$(printf "%06d" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc || echo "ERROR ln -vsf $rawsdir/vilma_-$(printf \"%06d\" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc" + fi + else + ln -sf $rawsdir/*_${period}* $sdir/ 2>/dev/null 1>&2 || { echo "ERROR creating links for $period ${RAW_EXP_IDS[$y]} $submodel" && exit 1 ; } + fi + + # Load and run the aggr ScriptFragment + . ${SCRIPT_DIR}/palmod2_aggregation_${esmod}_${submodel}.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_AGG +} + +function run_diag +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_DIAGS; then + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Clean up stdout/stderr from previous run of this script + errtemp_diag="${errdir_diag}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_diag} + err="${errtemp_diag}/err${period}" + rm -f ${err}* + + # Perform diagnostic for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$period_bk + # create time-axis + cdochain="" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment diag/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $sdir/out_diag" + echo "... writing log to $errtemp_diag" + + # Diagnostic Output + mkdir -p ${sdir}/tmp_diag + mkdir -p ${sdir}/out_diag + + # Load and run the diag ScriptFragment + . ${SCRIPT_DIR}/palmod2_diagnostic_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_DIAG +} + +function run_cmor +{ + # Loop over file output periods and load CMOR-Rewrite script fragment + if $RUN_CMOR; then + + for y in $(seq ${par1} ${par2}); do + + # Use working directory to hold .CHUNK and other tmp files + current_dir=${WORK_DIR[$y]}/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + if [[ -e $current_dir ]] && [[ "$PROCESS_CLIM" == "false" ]] + then + if $USE_CHUNKS + then + warn "appending to existing chunk" + elif $REMOVE_CHUNKS + then + warn "moving chunk info to backup" + mkdir -p ${WORK_DIR[$y]}/backup + mv -v --backup=numbered $current_dir ${WORK_DIR[$y]}/backup + else + die "please check if cmor is running or has already been run for this chunk. Use --force to re-run" + fi + else + if $USE_CHUNKS + then + die "cannot find chunk info for appending" + fi + fi + mkdir -p $current_dir + previous_dir=$PWD + # Link gridinfo files + ln -sf $SCRIPT_DIR/gridinfo*nc $current_dir/ + cd $current_dir + + # Define DRS root dir + dr=$dr_trunk/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + mkdir -p $dr + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Define decadal interval + dioce="$(( ${period} + ${inioffsetarr[$y]} - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup + 9 ))" + disl=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + + # Clean up stdout/stderr from previous run of this script + errtemp_cmor="${errdir_cmor}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_cmor} + err="${errtemp_cmor}/err${period}" + rm -f ${err}* + + # Perform CMOR rewrite for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + di=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # create time-axis + cdochain="-shifttime,$((inioffsetarr[$y] - spinup -5 ))year -shifttime,-3day" + di="$(( ${period_bk} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period_bk} + ${inioffsetarr[$y]} - $spinup ))" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + di="$(( ${period} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup ))" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment cmor/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $dr/$submodel" + echo "... writing log to $errtemp_cmor" + + # Output + mkdir -p $dr/$submodel + + #Location of Mapping table: + mt="${SCRIPT_DIR}/tables/${esmod}_${submodel}_${mip}_mapping.txt" + + #Define cdocmorinfo + it="${it_temp},${ca[${submodel}]}" + + # Load and run the CMOR-Rewrite ScriptFragment + . ${SCRIPT_DIR}/palmod2_cmor-rewrite_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + cd $previous_dir + done # EXP ID Index y + + # Run NCO ncatted cleanup of unappropriate/unnecessary attributes + # this is necessary since CMOR sets attributes necessary only for CMIP6 + # that are unnecessary/wrong for PalMod + post_nco + + fi # if RUN_CMOR +} + +function post_nco { + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup started for $dr" +# Load nco +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } + +# Post Processing with ncatted +#Find netCDF files in DRS directory +flist=( $( find $dr -name "*.nc" -type f | sort ) ) + +#Loop and run ncatted +echo "-> Looping over ${#flist[@]} netCDF files!" +for f in ${flist[@]} +do + echo "... editing $f" + ncatted -O -h -a further_info_url,global,d,, $f && echo "... deleted 'further_info_url'." || echo "... failed (ERROR)" + [[ "$(basename $f)" == *"cen"* ]] && { + ncatted -O -h -a frequency,global,m,c,"cen" $f && echo "... changed frequency to 'cen'." || echo "... failed (ERROR)" + } +done + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup ended for $dr" + +} + + + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +# Thereafter run aggregation, diagnostic, cmorization +if $PROCESS_CLIM +then + # Overwrite cmorstart/cmorend: + cmorstart=$iniyear + cmorend=$finyear + + # Read settings for clim1 + CLIMSUFFIX=_clim + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + + if [[ "$experiment" != "ssp"* ]] + then + # Reset Read_requested_config + l_linu=0 + unset DreqSettings + unset SliceSettings + unset UserSettings + unset TimeSlicesBounds + unset PriorityOrder + + # Read settings for clim2 + CLIMSUFFIX=_clim2 + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + fi +else + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM$SUFFIX.conf || die "error while reading request config" + $RUN_AGG && run_agg || echo "Could not run agg" + $RUN_DIAGS && run_diag || echo "Could not run diag" + $RUN_CMOR && run_cmor || echo "Could not run cmor" + wait +fi + + + +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE finished for $cmorstart-$cmorend$SUFFIX" + +# Update run dates and submit job scripts + +# $Id$ + + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR_cdocmorinfo b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR_cdocmorinfo new file mode 100644 index 0000000000000000000000000000000000000000..d35afb30fb8e384619a1069f00de8ff10e550c67 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p2f1-CR_cdocmorinfo @@ -0,0 +1,113 @@ +# +# experiment info: +# +_CONTROLLED_VOCABULARY_FILE=PalMod2_CV.json +_FORMULA_VAR_FILE=PalMod2_formula_terms.json +_AXIS_ENTRY_FILE=PalMod2_coordinate.json +CONVENTIONS="CF-1.7 PalMod-2.0" +TITLE="MPI-ESM1-2-1 output prepared for PalMod2" +_history_template="%s ; CMOR rewrote data to be consistent with <activity_id>, <Conventions> and CF standards." + +EXPERIMENT_ID=transient-deglaciation-interactive +EXPERIMENT="synchronously coupled transient deglaciation with interactive ice sheets and solid earth" +#Specify VARIANT_LABEL explicitly or realization_index, physics_index, initialization_index and forcing_index: +VARIANT_LABEL=r1i1p2f1 +REALIZATION_INDEX=1 +INITIALIZATION_INDEX=1 +PHYSICS_INDEX=2 +FORCING_INDEX=1 +VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but with increased vertical mixing in the ocean. For details see Mikoljawicz et al. (2024)." +COMMENT="Earth viscosity configuration for the solid earth model VILMA. The vertical viscosity structure is piecewise constant for the following specified layers of the earth: (1) 0 to 3.480000e+06 m from earth core: 1.000000e+19 Pa s. (2) 3.480000e+06 to 5.701000e+06 m from earth core: 1.000000e+22 Pa s. (3) 5.701000e+06 to 6.291000e+06 m from earth core: 4.000000e+20 Pa s. (4) 6.291000e+06 to 6.371000e+06 m from earth core: 1.000000e+30 Pa s." +ACTIVITY_ID=PalMod2 +#MIP_ERA=PalMod2 #ONLY CMIP6 +PROJECT_ID=PalMod2 +REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" +#FURTHER_INFO_URL="https://furtherinfo.es-doc.org/<mip_era>.<institution_id>.<source_id>.<experiment_id>.<sub_experiment_id>.<variant_label> +#Branch Info: If needed use the following 2 attributes to define the branch time +# in Parent_Time_Units and Required_Time_Units (=child) +# else use BRANCH_DATES to give the dates in YYYYMMDD,YYYYMMDD format +#BRANCH_TIME_IN_PARENT= +#BRANCH_TIME_IN_CHILD= +#BRANCH_DATES=19000101,18500101 +#BRANCH_METHOD="standard" +#PARENT_MIP_ERA=none #ONLY CMIP6 +#PARENT_ACTIVITY_ID=none +#PARENT_EXPERIMENT=none +#cmip6-spinup-HR +#PARENT_EXPERIMENT_ID=none +#PARENT_SOURCE_ID=none +#PARENT_TIME_UNITS="days since 1850-1-1 00:00:00" +#PARENT_VARIANT_LABEL=none +SUB_EXPERIMENT_ID=none +SUB_EXPERIMENT=none +# +#model info: +# +SOURCE_ID=MPI-ESM1-2-1-CR +#MODEL_ID=MPI-ESM1-2-1-CR +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" +SOURCE_TYPE="AOGCM ISM SLM" +#CALENDAR=proleptic_gregorian +#MAPPING_TABLE_DIR=cmip6_mapping_tables +#MAPPING_TABLE=MPIESM1_CMIP6.txt +#GRID_FILE_DIR=__GRID_FILE_DIR +#GRID_FILE=__GRID_FILE +GRID=gn +GRID_LABEL=gn +#NOMINAL_RESOLUTION read from external file +#For MPIOM/HAMOCC CR / GR30 +#NOMINAL_RESOLUTION="500 km" +#For ECHAM6/JSBACH CR / T31 +#NOMINAL_RESOLUTION="500 km" +CHAR_AXIS_TYPELICE="ice_free_land","ice_sheet","floating_ice","ice_free_sea" +CHAR_AXIS_VEGTYPE=bare_land,glacier,tropical_evergreen_trees,tropical_deciduous_trees,extra-tropical_evergreen_trees,extra-tropical_deciduous_trees,raingreen_shrubs,deciduous_shrubs,C3_grass,C4_grass,C3_pasture,C4_pasture,C3_crops,C4_crops +CHAR_AXIS_SOILPOOLS=acid-soluble_below_ground_leaf_litter,acid-soluble_below_ground_woody_litter,water-soluble_below_ground_leaf_litter,water-soluble_below_ground_woody_litter,ethanol-soluble_below_ground_leaf_litter,ethanol-soluble_below_ground_woody_litter,non-soluble_below_ground_leaf_litter,non-soluble_below_ground_woody_litter,humus_from_leaf_litter,humus_from_woody_litter +CHAR_AXIS_LANDUSE=primary_and_secondary_land,crops,pastures,urban +CHAR_AXIS_BASIN=global_ocean,atlantic_arctic_ocean,indian_pacific_ocean +CHAR_AXIS_OLINE=barents_opening,bering_strait,canadian_archipelago,denmark_strait,drake_passage,english_channel,pacific_equatorial_undercurrent,faroe_scotland_channel,florida_bahamas_strait,fram_strait,iceland_faroe_channel,indonesian_throughflow,mozambique_channel,taiwan_luzon_straits,windward_passage +CHAR_AXIS_SILINE=barents_opening,bering_strait,canadian_archipelago,fram_strait +#spectband for the 3 aeropt variables +CHAR_AXIS_SPECTBAND_aeroptbnd=1818182 +CHAR_AXIS_SPECTBAND_aeroptbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aeroptbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerssabnd=1818182 +CHAR_AXIS_SPECTBAND_aerssabnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerssabnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerasymbnd=1818182 +CHAR_AXIS_SPECTBAND_aerasymbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerasymbnd_UNITS="m-1" +# 2d-spectband for the albedos +CHAR_AXIS_SPECTBAND_albdirbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdirbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdirbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_albdiffbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdiffbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdiffbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_solbnd=1818182 +CHAR_AXIS_SPECTBAND_solbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_solbnd_UNITS="m-1" +#T_AXIS="cmip" causes the time axis to be rewritten according to the requested time stamps +T_AXIS="cmip" +#OUTPUT_MODE="r" +OUTPUT_MODE="a" +MAX_SIZE=0 +SAVE_CHUNK="n" +#For files without time axis, if one is requested: +#firsttimeval=1 (1850-01-02 00:00:00 wenn days since 1850-01-01 00:00:00) +FIRSTTIMEVAL=1 +# +# institution and contact info: +# +# none of these can be set in the command line +# +DEFLATE_LEVEL=1 +CONTACT=palmod2-mpi-esm@dkrz.de +# +# MPI-M +# +INSTITUTION_ID=MPI-M +INSTITUTION="Max Planck Institute for Meteorology, Hamburg 20146, Germany" +LICENSE="PalMod2 model data produced by MPI-M is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law." +#MIP_TABLE_DIR="/pool/data/CMIP6/cmip6-cmor-tables/Tables/" +MIP_TABLE_DIR="/work/bm0021/PalMod2/cmor_tables/" diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl new file mode 100755 index 0000000000000000000000000000000000000000..303c01895b18cb412d23b19bee7a5ad5948b5166 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl @@ -0,0 +1,64 @@ +#! /bin/sh -e +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --time=48:00:00 +#SBATCH --partition=shared +#SBATCH --mail-type=FAIL +#SBATCH --output=%x_%j.log + +# Number of sub-simulations +n_subsim=4 +#initial and final year of the experiment +spinup=1000 +iniyeararr=( $((4000+spinup)) 2000 2000 2000 ) +finyeararr=( 8999 8999 8999 8999 ) +iniyearoffset=0 +iniyear=$(( 1 + $iniyearoffset + $spinup )) +finyear=$(( 26000 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) +# Time axis (26000-1 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 1 BP - 7000 yrs - 19001-26000 - 17001 + +# Chunksize +# Note that there are prerequisites concerning the chunksize: +# - the defined decadal timeslizes may not overlap between two chunks! +# - decadal bounds have to be defined accordingly - "???01231" in this case +# - usually this is the case by default due to decadal model output! +chunksize=100 + +# Create list +for i in $(seq 0 $(( n_subsim - 1 )) ) +do + for yyyy in $(seq ${iniyeararr[$i]} ${finyeararr[$i]} ) + do + paramarr+=( "$i $yyyy" ) + done +done + +rm -f cmor_ctl_list_interactive_synch_r1i1p3f1 +in=0 +for i in $(seq $((iniyear-iniyear)) $chunksize $((finyear-iniyear))) +do + [[ $i -eq $((iniyear-iniyear)) ]] && continue + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((i-1))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((i-1))]} | cut -d " " -f2) + in=$i + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p3f1 +done +[[ $i -ne $((finyear-iniyear)) ]] && { + li=$(echo ${paramarr[$in]} | cut -d " " -f1) + ly=$(echo ${paramarr[$in]} | cut -d " " -f2) + ui=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f1) + uy=$(echo ${paramarr[$((finyear-iniyear))]} | cut -d " " -f2) + echo "$li $ui $ly $uy" >> cmor_ctl_list_interactive_synch_r1i1p3f1 +} + +make -k -j 19 -f transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl.mk "$@" + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl.mk b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl.mk new file mode 100755 index 0000000000000000000000000000000000000000..6906d14c1213dd8f49a08c8773e0e429ee7d9f65 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.cmor_ctl.mk @@ -0,0 +1,44 @@ +EXP_ID = transient-deglaciation-interactive_r1i1p3f1-CR + +ACCOUNT = bm0021 +PARTITION = compute + +SUFFIX = +ARCHIVE_SUFFIX = + +TARGET_STEP=cmor +NUMCHUNKS=$(shell cat cmor_ctl_list_interactive_synch_r1i1p3f1 | wc -l ) + +AGGR_TIME = 00:30:00 +DIAGS_TIME = 01:00:00 +CMOR_TIME = 04:00:00 + +CMOR_FLAGS = + +SBATCHFLAGS=-W + +MESSAGE = $$(date +%Y-%m-%dT%H:%M:%S): CMIP6 diagnostics and CMOR rewriting ($(SUFFIX:_%=%)) + +.PHONY: all +.PRECIOUS: targets/$(EXP_ID).aggr$(SUFFIX).% targets/$(EXP_ID).diags$(SUFFIX).% targets/$(EXP_ID).cmor$(SUFFIX).% + + + +all: + @echo "$(MESSAGE) started" + mkdir -vp targets + $(MAKE) $(MFLAGS) -f $(MAKEFILE_LIST) $(addprefix targets/$(EXP_ID).$(TARGET_STEP)$(SUFFIX).,$(shell seq 1 $(NUMCHUNKS))) + @echo "$(MESSAGE) finished" + +targets/$(EXP_ID).aggr$(SUFFIX).%: + sbatch $(SBATCHFLAGS) --time=$(AGGR_TIME) --job-name=$(EXP_ID)_runpp_aggr$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -A $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p3f1) + @touch $@ + +targets/$(EXP_ID).diags$(SUFFIX).%: targets/$(EXP_ID).aggr$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(DIAGS_TIME) --job-name=$(EXP_ID)_runpp_diag$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -d $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p3f1) + @touch $@ + +targets/$(EXP_ID).cmor$(SUFFIX).%: targets/$(EXP_ID).diags$(SUFFIX).% + sbatch $(SBATCHFLAGS) --time=$(CMOR_TIME) --job-name=$(EXP_ID)_runpp_cmor$(SUFFIX) --output=%x_%j.log --comment=$* $(EXP_ID).runpp -s '$(SUFFIX)' -S '$(ARCHIVE_SUFFIX)' -c $(CMOR_FLAGS) $(shell sed -n '$(*)'p < cmor_ctl_list_interactive_synch_r1i1p3f1) + @touch $@ + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.runpp b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.runpp new file mode 100755 index 0000000000000000000000000000000000000000..f45bf4a7ce7608a92267f55b650e1cb24656c484 --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR.runpp @@ -0,0 +1,724 @@ +#!/bin/ksh +# +# PalMod .runpp +# +# Wrapper Script Agg+Diag+CMOR MPI-ESM1-2 by Martin Schupfner, DKRZ +# +### Batch Queuing System is SLURM +#SBATCH --partition=compute +#SBATCH --nodes=1 +#SBATCH --mem=100G +#SBATCH --time=01:30:00 +#SBATCH --mail-type=none +#SBATCH --account=bm0021 +#SBATCH --qos=esgf +#SBATCH --exclusive +#SBATCH --output=transient-deglaciation-interactive_r1i1p3f1-CR.runpp_%j.log + +DEBUG_LEVEL=${DEBUG_LEVEL:-0} + +# Support log style output +export LANG=C +print () { command print "$(date +'%F %T'):" "$@"; } +print_re='^[0-9]+-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}' + +warn () { print 'Hey:' "$@" >&2; } +die () { print 'Oops:' "$@" >&2; return 1; } + +# Bail out on error +trap 'print Error at line $LINENO >&2' ERR +set -eu + +# Disable core file creation +ulimit -c 0 + +# Print command info +[[ $DEBUG_LEVEL -ge 2 ]] && set -x + +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } +alias ncatted=/sw/spack-levante/nco-5.0.6-3xkdth/bin/ncatted + +######################################### +# Define specifics about the simulation +######################################### + +#Root directory of all scripts, outdata, logs etc +EXP_ID=transient-deglaciation-interactive_r1i1p3f1-CR +#EXP_DIR_TRUNK=/work/bk1192/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p3f1-CR +EXP_DIR_TRUNK=/work/kd1292/ESGF_Buff/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p3f1-CR + +#initial files for aggregation +INPUT_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous + +# RAW Data - path and sub-simulations +RAW_EXP_DIR_TRUNK=/work/bk1192/WP1.1/MPIM_transient_deglaciation_synchronous +# As usually the Experiment is composed of several sub-simulations, define them as array +RAW_EXP_IDS=( pmo0014a pmo0014b pmo0014c pmo0014d ) +# Parent experiment that the first RAW_EXP_ID branched from +# (used for input data of the parent that is required for aggregation) +# !! spinup - the aggregation will fail if the spinup period +# !! is as long or longer than +# !! the length of the first sub simulation! +spinup=1000 +RAW_EXP_ID_PARENT=( None pmo0014a pmo0014b pmo0014c ) # cmorizing 26000-1 BP as 1-26000 AD +if [[ $spinup -ne 0 ]]; then + RAW_EXP_ID_PARENT[0]=${RAW_EXP_IDS[0]} # cmorizing (26000-spinup)-1 BP as 1-(26000-spinup) AD +fi + +echo ${RAW_EXP_IDS[@]} +echo ${RAW_EXP_ID_PARENT[@]} + +#Work dir +WORK_DIR_TRUNK=$EXP_DIR_TRUNK/work + +#Where to find the scripts (runpp etc.) +SCRIPT_DIR=${EXP_DIR_TRUNK}/scripts +SCRIPT_DIR=/work/bm0021/PalMod2/cmor/mpiesm/scripts + + + +############################ +#Define necessary variables +############################ + +#Where to find cdo (incl. CMOR operator), eg.: +cdo="/work/bm0021/cdo_incl_cmor/cdo-2022-09-20_cmor3.6.0_gcc/bin/cdo -v" # surely working version +#cdo="/work/bm0021/cdo_incl_cmor/cdo-2024-09-11_cmor3.9.0_gcc/bin/cdo -v" # latest version +cdozg="/sw/spack-levante/cdo-1.9.10-j5frmz/bin/cdo -v" + +# Base directory for DataRequest related headers/scripts +SCRIPT_ROOT=${SCRIPT_DIR} + +#Where to find the functions +fpath=/work/bm0021/PalMod2/cmor/functions + +#Where to find the configuration +cpath=${SCRIPT_ROOT}/conf + +#Models +atmmod=echam6 +ocemod=mpiom +srfmod=jsbach +esmod=MPI-ESM1-2 +icemod=mpism +slmod=vilma + +#Chunks +chunks+=([echam6]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([jsbach]=" 0 1 2 3 4 5 6 7 8 9 ") +chunks+=([mpiom]=" 0 ") +chunks+=([jsbachdec]=" 0 ") +atmmod_dec_chunk="???0123124" +srfmod_dec_chunk="???0123124" +srfmod_input_dec_chunk="???0123124" +ocemod_dec_chunk="???1123124" +icemod_dec_chunk="???1123124" +slmod_dec_chunk="???1123124" +slmod_input_dec_chunk="???0123124" +ocemod_fxyear=3000 +chunks+=([mpism]=" 0 ") +chunks+=([vilma]=" 0 1 ") +chunks+=([vilmadec]=" 0 ") + +#InfoTable(s) +# Define here the "cdocmorinfo"-File or "eum"-Files +# Multiple files possible with "," as delimiter, eg: +# it=expinfo.txt,userinfo.txt,modelinfo.txt +it_temp="${SCRIPT_ROOT}/transient-deglaciation-interactive_r1i1p3f1-CR_cdocmorinfo" +ca+=([mpiom]="${SCRIPT_ROOT}/cdocmorinfo_mpiom_CR") +ca+=([echam6]="${SCRIPT_ROOT}/cdocmorinfo_echam6_CR") +ca+=([jsbach]="${SCRIPT_ROOT}/cdocmorinfo_jsbach_CR") +ca+=([mpism]="${SCRIPT_ROOT}/cdocmorinfo_mpism_CR") +ca+=([vilma]="${SCRIPT_ROOT}/cdocmorinfo_vilma_CR") + +#Experiment etc +experiment=transient-deglaciation-interactive +member=r1i1p3f1 +mip=PalMod2 +vd=v20250105 +#vd=v$(date '+%Y%m%d') #CMOR version directory name, should be a date in format YYYYMMDD + +#Where to store errors +errdir=${EXP_DIR_TRUNK}/logs/errors +errdir_cmor=${errdir}_cmor +errdir_diag=${errdir}_diag +errdir_agg=${errdir}_agg + +#initial and final year of the experiment +iniyeararr=($((4000+spinup)) 2000 2000 2000) # 26000-1 BP +finyeararr=(8999 8999 8999 8999) +iniyearoffset=0 # additional optional offset +iniyear=$(( $iniyearoffset + 1 )) +finyear=$(( 26000 + $iniyearoffset - $spinup )) +#offset compared to startyear +inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10001 + $iniyearoffset )) $(( 17001 + $iniyearoffset )) ) # 26000-1 BP +# Time axis (26000-1 BP) +## exp time total yrs new exp time offset +#a - 26000-21001 BP - 5000 yrs - 1- 5000 - - 3999 +#b - 21000-14001 BP - 7000 yrs - 5001-12000 - 3001 +#c - 14000- 7001 BP - 7000 yrs - 12001-19000 - 10001 +#d - 7000- 1 BP - 7000 yrs - 19001-26000 - 17001 + +#pmo0014a-d: Transient simulation of the last deglaciation with interactive ice +#sheets and synchronous coupling between MPI-ESM and the ice sheet-solid earth model. +#GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). +#They are structured as follows. +# +# pmo0014a: Simulation year 4000-8999 spans the time period 26000 +# years BP to 21000 years BP. +# pmo0014b: Simulation years 2000-8999; years 21000 to 14000 BP +# pmo0014c: Simulation years 2000-8999; years 14000 to 7000 BP +# pmo0014d: Simulation years 2000-8999; years 7000 BP to 0 BP +# + +# Command line options +RUN_AGG=true +RUN_DIAGS=true +RUN_CMOR=true +SUFFIX= +CLIMSUFFIX= +ARCHIVE_SUFFIX= +USE_CHUNKS=false +REMOVE_CHUNKS=false +PROCESS_CLIM=false +while [[ "$1" == -* ]] +do + OPT= + ARG= + case "$1" in + -d|--diags|--diags-only) RUN_CMOR=false; RUN_AGG=false;; + -c|--cmor|--cmor-only) RUN_DIAGS=false; RUN_AGG=false;; + -A|--agg|--agg-only) RUN_DIAGS=false; RUN_CMOR=false;; + -C|--clim) PROCESS_CLIM=true;; + -s|--suffix) OPT=-s; ARG=SUFFIX;; + -S|--archive-suffix) OPT=-S; ARG=ARCHIVE_SUFFIX;; + -f|--force) REMOVE_CHUNKS=true;; + -a|--append) USE_CHUNKS=true;; + --) shift; break;; + -*) die "invalid option '$1'";; + esac + if [[ -n "$OPT" ]] + then + shift + [[ $# -lt 1 ]] && die "missing argument for option '$OPT'" + eval "$ARG='$1'" + fi + shift +done + +echo "-----------------" +echo $0 $1 $2 $3 $4 +echo "-----------------" + +#Write Output to: +dr_trunk=${EXP_DIR_TRUNK}/archive$ARCHIVE_SUFFIX + + + +############################################################################### +# No user input beyond this line necessary (usually) +############################################################################### + +# Store parameters +par1=$1 +par2=$2 +par3=$3 +par4=$4 +n_arr=${#inioffsetarr[@]} + +#time interval of the experiment to standardize +if [[ ${#iniyeararr[@]} != ${#inioffsetarr[@]} ]] || [[ ${#iniyeararr[@]} != ${#finyeararr[@]} ]] || [[ ${#iniyeararr[@]} != ${#RAW_EXP_IDS[@]} ]]; then + die 'Each sub-simulation needs a specified iniyear, finyear and inioffset!' +else + for y in $(seq 0 $(( n_arr - 1 )) ); do + SDIR+=( ${EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + RAWSDIR+=( ${RAW_EXP_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + WORK_DIR+=( ${WORK_DIR_TRUNK}/${RAW_EXP_IDS[$y]} ) + done + [[ -z "$2" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$3" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + [[ -z "$4" ]] && [[ "$PROCESS_CLIM" == "false" ]] && die 'invalid number of parameters; need index of start and end simulations, start year (of first index) and end year (of second index) as YYYY' + for y in $(seq 0 $(( n_arr - 1 )) ); do + if [[ $y -lt $par1 ]] || [[ $y -gt $par2 ]]; then + lrel=-1 + urel=-1 + labs=-1 + uabs=-1 + elif [[ $y -eq $1 ]] && [[ $1 -eq $2 ]]; then + lrel=$3 + urel=$4 + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $1 ]]; then + lrel=$3 + urel=${finyeararr[$y]} + labs=$(( $3 + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + elif [[ $y -eq $2 ]]; then + lrel=${iniyeararr[$y]} + urel=$4 + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( $4 + ${inioffsetarr[$y]} - $spinup )) + else + lrel=${iniyeararr[$y]} + urel=${finyeararr[$y]} + labs=$(( ${iniyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + uabs=$(( ${finyeararr[$y]} + ${inioffsetarr[$y]} - $spinup )) + fi + [[ $urel -lt $lrel ]] && die 'iniyear, finyear arrays not properly set up!' + [[ $uabs -lt $labs ]] && die 'iniyear, finyear arrays not properly set up!' + SUB_SIM_REL_L+=( $lrel ) + SUB_SIM_REL_U+=( $urel ) + SUB_SIM_ABS_L+=( $labs ) + SUB_SIM_ABS_U+=( $uabs ) + [[ $lrel -eq -1 ]] && continue + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_L[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_L[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ "$PROCESS_CLIM" == "false" ]] && { [[ ${SUB_SIM_REL_U[$y]} -lt ${iniyeararr[$y]} ]] || [[ ${SUB_SIM_REL_U[$y]} -gt ${finyeararr[$y]} ]] ; } && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + done + echo ${SUB_SIM_REL_L[@]} + echo ${SUB_SIM_REL_U[@]} + echo ${SUB_SIM_ABS_L[@]} + echo ${SUB_SIM_ABS_U[@]} + [[ $1 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $2 -ge ${#iniyeararr[@]} ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + [[ $1 -gt $2 ]] && die 'erroneous input - input does not make sense along with the configured iniyear, finyear arrays' + cmorstart=$(( $3 + ${inioffsetarr[$1]} - $spinup )) + cmorend=$(( $4 + ${inioffsetarr[$2]} -spinup )) +fi +MESSAGE='PalMod2' +$RUN_AGG && MESSAGE+=' - Aggregation - ' +$RUN_DIAGS && MESSAGE+=' - Diagnostics - ' +$RUN_CMOR && MESSAGE+=" - CMOR rewriting - " +$PROCESS_CLIM && MESSAGE+=' for only climatological variables' +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE started for ${cmorstart}-${cmorend} $SUFFIX" +print " ... translating to ${RAW_EXP_IDS[$1]}@$3 to ${RAW_EXP_IDS[$2]}@$4" + +#exit 0 + + + +############################## +# Load the required functions +# function_Read_request_config: read data request / user configuration and initialize the if_requested check +# function_if_requested: checks if the currently processed variable is requested for the current timestep +# function_find_file: searches for inputfiles +############################## +. $fpath/function_Read_request_config_palmod +. $fpath/function_if_requested +. $fpath/function_find_file + +#Load predefined timeslices (depends on $iniyear/$finyear) +. $cpath/TimeSlices.h + +##Additionally define custom TimeSlices +## Example on how to define TimeSlices +## format: YYYYMMDDHH-YYYYMMDDHH +## +#TimeSlices+=([custom1]=(1850010100-1850010100)) +#TimeSlices+=([custom2]=(1850010100-1850123124)) +##TimeSlice dependend on variable +#TimeSlices+=([custom3]=(${iniyear}010100-${iniyear}123124)) +##TimeSlice dependend on arithmetics using variable +#TimeSlices+=([custom4]=($((iniyear+121))010100-$((iniyear+150))123124)) + +##Define SettingsContainer +## The following Option 3hrtest will activate the listed 3hr variables and deactivate any other variable for the given member (= realisation) +## The UserSettings for the given experiment have to contain the line: +## Option: 3hrtest = True +## or the setting will not be active! +#SettingsContainer+=([3hrtest]=([3hr]=(clt hfls hfss pr prc ps rlds rlus rsds rsus tas tos uas vas))) +#SettingsContainer[3hrtest]+=([${member}]=(${member}:False)) + +#Define Settings for Requested_vars.conf +ism=True # Produce PISM vars +slm=True # Produce vilma vars + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +rrc_option=-s +[[ $DEBUG_LEVEL -ge 1 ]] && rrc_option= +[[ $DEBUG_LEVEL -ge 2 ]] && rrc_option=-v +rrc_option=-v + + +################################# +# Run agg, diag and cmor-rewrite +################################# + +function run_agg +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_AGG; then + + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + period_bk=$period + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + print "Aggregation $chunk ($period): Reading forcing/input of year $inv_chunk_year (legacy) $period (latest)" + + # Clean up stdout/stderr from previous run of this script + errtemp_agg="${errdir_agg}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_agg} + err="${errtemp_agg}/err${period}" + rm -f ${err}* + + # Read input file + if [[ "${iniyeararr[$y]}" == "$period" ]] + then + echo "Reading from parent ${RAW_EXP_ID_PARENT[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_ID_PARENT[$y]}/restart/topo/TOPO_$period.nc + else + echo "Reading from ${RAW_EXP_IDS[$y]} jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc" + input_file_jsbach=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/jsbach_T31GR30_11tiles_5layers_natural-veg_$period.nc + input_file_glac_fx=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$((period+9)).nc + input_file_glac=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/GLAC_$period.nc + input_file_topo=$INPUT_DIR_TRUNK/${RAW_EXP_IDS[$y]}/restart/topo/TOPO_$period.nc + fi + + # Perform aggregation for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform no time shift + cdochain="" + echo "--------- $period $period_bk $chunk" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment aggr/${RAW_EXP_IDS[$y]}/$submodel/$period + + # Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + rawsdir_pism_ant=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_ANT + rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH + echo "... writing output to $sdir/out_aggr" + echo "... writing log to $errtemp_agg" + + # Create output dirs + mkdir -p ${sdir}/tmp_aggr + mkdir -p ${sdir}/out_aggr + + # Create softlinks to raw model output - PISM requires special treatment + if [[ $submodel == "$icemod" ]]; then + #ln -sf $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + #ln -sf $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + cp -v $rawsdir_pism_ant/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_ant_${period}.nc + ncatted -O -h -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_ant_${period}.nc || { echo "ERROR ncatted $sdir/pism_ant_${period}.nc" ; exit 1 ; } + cp -v $rawsdir_pism_nh/pism_-$(printf "%06d" $((inv_chunk_year - 10)))/pism_-$(printf "%06d" $((inv_chunk_year - 10))).nc $sdir/pism_nh_${period}.nc + ncatted -O -h -a ellipsoid,mapping,o,c,WGS84 -a grid_mapping_name,mapping,o,c,polar_stereographic -a false_easting,mapping,o,d,0. -a false_northing,mapping,o,d,0. -a latitude_of_projection_origin,mapping,o,d,90. -a standard_parallel,mapping,o,d,70. -a straight_vertical_longitude_from_pole,mapping,o,d,-45. -a scale_factor_at_projection_origin,mapping,o,d,1.0 $sdir/pism_nh_${period}.nc || { echo "ERROR ncatted $sdir/pism_nh_${period}.nc" ; exit 1 ; } + elif [[ $submodel == "vilma" ]]; then + if [[ "${chunks[${submodel}dec]}" == *" ${period: -1} "* ]]; then + ln -vsf $rawsdir/vilma_-$(printf "%06d" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc || echo "ERROR ln -vsf $rawsdir/vilma_-$(printf \"%06d\" $((inv_chunk_year - 10)))/rsl.nc $sdir/rsl_${period_bk}.nc" + fi + else + ln -sf $rawsdir/*_${period}* $sdir/ 2>/dev/null 1>&2 || { echo "ERROR creating links for $period ${RAW_EXP_IDS[$y]} $submodel" && exit 1 ; } + fi + + # Load and run the aggr ScriptFragment + . ${SCRIPT_DIR}/palmod2_aggregation_${esmod}_${submodel}.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Aggregation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_AGG +} + +function run_diag +{ + # Loop over file output periods and load diagnostic script fragment + if $RUN_DIAGS; then + for y in $(seq ${par1} ${par2}); do + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Clean up stdout/stderr from previous run of this script + errtemp_diag="${errdir_diag}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_diag} + err="${errtemp_diag}/err${period}" + rm -f ${err}* + + # Perform diagnostic for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + elif [[ "$submodel" == "$slmod" ]]; then + period=$period_bk + # create time-axis + cdochain="" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment diag/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $sdir/out_diag" + echo "... writing log to $errtemp_diag" + + # Diagnostic Output + mkdir -p ${sdir}/tmp_diag + mkdir -p ${sdir}/out_diag + + # Load and run the diag ScriptFragment + . ${SCRIPT_DIR}/palmod2_diagnostic_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): Diagnostic ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + done # EXP ID Index y + fi # if RUN_DIAG +} + +function run_cmor +{ + # Loop over file output periods and load CMOR-Rewrite script fragment + if $RUN_CMOR; then + + for y in $(seq ${par1} ${par2}); do + + # Use working directory to hold .CHUNK and other tmp files + current_dir=${WORK_DIR[$y]}/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + if [[ -e $current_dir ]] && [[ "$PROCESS_CLIM" == "false" ]] + then + if $USE_CHUNKS + then + warn "appending to existing chunk" + elif $REMOVE_CHUNKS + then + warn "moving chunk info to backup" + mkdir -p ${WORK_DIR[$y]}/backup + mv -v --backup=numbered $current_dir ${WORK_DIR[$y]}/backup + else + die "please check if cmor is running or has already been run for this chunk. Use --force to re-run" + fi + else + if $USE_CHUNKS + then + die "cannot find chunk info for appending" + fi + fi + mkdir -p $current_dir + previous_dir=$PWD + # Link gridinfo files + ln -sf $SCRIPT_DIR/gridinfo*nc $current_dir/ + cd $current_dir + + # Define DRS root dir + dr=$dr_trunk/cmor${SUFFIX}_${cmorstart}-${cmorend}${CLIMSUFFIX} + mkdir -p $dr + + for period in $(seq ${SUB_SIM_REL_L[$y]} ${SUB_SIM_REL_U[$y]}); do + # Define the chunk that is tested by if_requested (YYYYMMDDHH-YYYYMMDDHH) + chunk=$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')010100-$( echo $(( ${period} + ${inioffsetarr[$y]} - $spinup )) | awk '{ printf "%06d", $0 }')123124 + + l_chunk=$(echo $chunk | cut -d "-" -f1) + r_chunk=$(echo $chunk | cut -d "-" -f2) + period_bk=$period + + l_chunk_year=${l_chunk%??????} + r_chunk_year=${r_chunk%??????} + + inv_chunk_year=$(( 1 + ${finyear} - ${l_chunk_year##+(0)} )) + + # Define decadal interval + dioce="$(( ${period} + ${inioffsetarr[$y]} - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup + 9 ))" + disl=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + + # Clean up stdout/stderr from previous run of this script + errtemp_cmor="${errdir_cmor}${SUFFIX}${CLIMSUFFIX}/${RAW_EXP_IDS[$y]}/${RAW_EXP_IDS[$y]}_${period}" + mkdir -p ${errtemp_cmor} + err="${errtemp_cmor}/err${period}" + rm -f ${err}* + + # Perform CMOR rewrite for each submodel + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do + + if [[ "$submodel" == "$icemod" ]]; then + period=$(( inv_chunk_year - 10 )) + # perform time shift for selected variables + cdochain="-shifttime,-5year -shifttime,${finyear}year" # for decadal time intervals only! + di=${l_chunk_year##+(0)},$(( ${l_chunk_year##+(0)} + 9 )) + elif [[ "$submodel" == "$slmod" ]]; then + period=$(( inv_chunk_year - 10 )) + # create time-axis + cdochain="-shifttime,$((inioffsetarr[$y] - spinup -5 ))year -shifttime,-3day" + di="$(( ${period_bk} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period_bk} + ${inioffsetarr[$y]} - $spinup ))" + else + period=$period_bk + # perform time shift for selected variables + cdochain="-shifttime,$((inioffsetarr[$y] - spinup))year -shifttime,-3day" + di="$(( ${period} + ${inioffsetarr[$y]} - 9 - $spinup )),$(( ${period} + ${inioffsetarr[$y]} - $spinup ))" + fi + + # Chunking + [[ "${chunks[$submodel]}" == *" ${period: -1} "* ]] && { + + # Show progress + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation started for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + sh -c 'scontrol update JobId=$SLURM_JOB_ID Comment="$*"' scomment cmor/${RAW_EXP_IDS[$y]}/$submodel/$period + + #Location of input/output + sdir=${SDIR[$y]}/outdata/$submodel + rawsdir=${RAWSDIR[$y]}/outdata/$submodel + echo "... writing output to $dr/$submodel" + echo "... writing log to $errtemp_cmor" + + # Output + mkdir -p $dr/$submodel + + #Location of Mapping table: + mt="${SCRIPT_DIR}/tables/${esmod}_${submodel}_${mip}_mapping.txt" + + #Define cdocmorinfo + it="${it_temp},${ca[${submodel}]}" + + # Load and run the CMOR-Rewrite ScriptFragment + . ${SCRIPT_DIR}/palmod2_cmor-rewrite_${esmod}_${submodel}_auto.h + wait + print "$(date +%Y-%m-%dT%H:%M:%S): CMORisation ended for ${RAW_EXP_IDS[$y]} $submodel $chunk ($period) ..." + } + + done # submodel + done # period + cd $previous_dir + done # EXP ID Index y + + # Run NCO ncatted cleanup of unappropriate/unnecessary attributes + # this is necessary since CMOR sets attributes necessary only for CMIP6 + # that are unnecessary/wrong for PalMod + post_nco + + fi # if RUN_CMOR +} + +function post_nco { + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup started for $dr" +# Load nco +#module load nco || { echo "Oops: Could not load NCO!" && exit 1 ; } + +# Post Processing with ncatted +#Find netCDF files in DRS directory +flist=( $( find $dr -name "*.nc" -type f | sort ) ) + +#Loop and run ncatted +echo "-> Looping over ${#flist[@]} netCDF files!" +for f in ${flist[@]} +do + echo "... editing $f" + ncatted -O -h -a further_info_url,global,d,, $f && echo "... deleted 'further_info_url'." || echo "... failed (ERROR)" + [[ "$(basename $f)" == *"cen"* ]] && { + ncatted -O -h -a frequency,global,m,c,"cen" $f && echo "... changed frequency to 'cen'." || echo "... failed (ERROR)" + } +done + +print "$(date +%Y-%m-%dT%H:%M:%S): NCO cleanup ended for $dr" + +} + + + +#Initialize DataRequest/User Configuration for the if_requested function +# This will read all SettingsContainers, TimeSlices and the configuration file +# Thereafter run aggregation, diagnostic, cmorization +if $PROCESS_CLIM +then + # Overwrite cmorstart/cmorend: + cmorstart=$iniyear + cmorend=$finyear + + # Read settings for clim1 + CLIMSUFFIX=_clim + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + + if [[ "$experiment" != "ssp"* ]] + then + # Reset Read_requested_config + l_linu=0 + unset DreqSettings + unset SliceSettings + unset UserSettings + unset TimeSlicesBounds + unset PriorityOrder + + # Read settings for clim2 + CLIMSUFFIX=_clim2 + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM${SUFFIX}${CLIMSUFFIX}.conf || die "error while reading request config" + # Run diag&cmor + run_diag + run_cmor + fi +else + Read_request_config $rrc_option AllExp ${cpath}/${mip}_requested_vars_AllExp_ISM_SLM$SUFFIX.conf || die "error while reading request config" + $RUN_AGG && run_agg || echo "Could not run agg" + $RUN_DIAGS && run_diag || echo "Could not run diag" + $RUN_CMOR && run_cmor || echo "Could not run cmor" + wait +fi + + + +print "$(date +%Y-%m-%dT%H:%M:%S): $MESSAGE finished for $cmorstart-$cmorend$SUFFIX" + +# Update run dates and submit job scripts + +# $Id$ + + diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR_cdocmorinfo b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR_cdocmorinfo new file mode 100644 index 0000000000000000000000000000000000000000..89444d13b8a6d60abd08ce2baaf5d63cd9c578fd --- /dev/null +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p3f1-CR_cdocmorinfo @@ -0,0 +1,113 @@ +# +# experiment info: +# +_CONTROLLED_VOCABULARY_FILE=PalMod2_CV.json +_FORMULA_VAR_FILE=PalMod2_formula_terms.json +_AXIS_ENTRY_FILE=PalMod2_coordinate.json +CONVENTIONS="CF-1.7 PalMod-2.0" +TITLE="MPI-ESM1-2-1 output prepared for PalMod2" +_history_template="%s ; CMOR rewrote data to be consistent with <activity_id>, <Conventions> and CF standards." + +EXPERIMENT_ID=transient-deglaciation-interactive +EXPERIMENT="synchronously coupled transient deglaciation with interactive ice sheets and solid earth" +#Specify VARIANT_LABEL explicitly or realization_index, physics_index, initialization_index and forcing_index: +VARIANT_LABEL=r1i1p3f1 +REALIZATION_INDEX=1 +INITIALIZATION_INDEX=1 +PHYSICS_INDEX=3 +FORCING_INDEX=1 +VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation used climatological volcanic forcing representing PI. GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978). Equivalent to p1 but with decreased vertical mixing in the ocean. For details see Mikoljawicz et al. (2024)." +COMMENT="Earth viscosity configuration for the solid earth model VILMA. The vertical viscosity structure is piecewise constant for the following specified layers of the earth: (1) 0 to 3.480000e+06 m from earth core: 1.000000e+19 Pa s. (2) 3.480000e+06 to 5.701000e+06 m from earth core: 1.000000e+22 Pa s. (3) 5.701000e+06 to 6.291000e+06 m from earth core: 4.000000e+20 Pa s. (4) 6.291000e+06 to 6.371000e+06 m from earth core: 1.000000e+30 Pa s." +ACTIVITY_ID=PalMod2 +#MIP_ERA=PalMod2 #ONLY CMIP6 +PROJECT_ID=PalMod2 +REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" +#FURTHER_INFO_URL="https://furtherinfo.es-doc.org/<mip_era>.<institution_id>.<source_id>.<experiment_id>.<sub_experiment_id>.<variant_label> +#Branch Info: If needed use the following 2 attributes to define the branch time +# in Parent_Time_Units and Required_Time_Units (=child) +# else use BRANCH_DATES to give the dates in YYYYMMDD,YYYYMMDD format +#BRANCH_TIME_IN_PARENT= +#BRANCH_TIME_IN_CHILD= +#BRANCH_DATES=19000101,18500101 +#BRANCH_METHOD="standard" +#PARENT_MIP_ERA=none #ONLY CMIP6 +#PARENT_ACTIVITY_ID=none +#PARENT_EXPERIMENT=none +#cmip6-spinup-HR +#PARENT_EXPERIMENT_ID=none +#PARENT_SOURCE_ID=none +#PARENT_TIME_UNITS="days since 1850-1-1 00:00:00" +#PARENT_VARIANT_LABEL=none +SUB_EXPERIMENT_ID=none +SUB_EXPERIMENT=none +# +#model info: +# +SOURCE_ID=MPI-ESM1-2-1-CR +#MODEL_ID=MPI-ESM1-2-1-CR +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" +SOURCE_TYPE="AOGCM ISM SLM" +#CALENDAR=proleptic_gregorian +#MAPPING_TABLE_DIR=cmip6_mapping_tables +#MAPPING_TABLE=MPIESM1_CMIP6.txt +#GRID_FILE_DIR=__GRID_FILE_DIR +#GRID_FILE=__GRID_FILE +GRID=gn +GRID_LABEL=gn +#NOMINAL_RESOLUTION read from external file +#For MPIOM/HAMOCC CR / GR30 +#NOMINAL_RESOLUTION="500 km" +#For ECHAM6/JSBACH CR / T31 +#NOMINAL_RESOLUTION="500 km" +CHAR_AXIS_TYPELICE="ice_free_land","ice_sheet","floating_ice","ice_free_sea" +CHAR_AXIS_VEGTYPE=bare_land,glacier,tropical_evergreen_trees,tropical_deciduous_trees,extra-tropical_evergreen_trees,extra-tropical_deciduous_trees,raingreen_shrubs,deciduous_shrubs,C3_grass,C4_grass,C3_pasture,C4_pasture,C3_crops,C4_crops +CHAR_AXIS_SOILPOOLS=acid-soluble_below_ground_leaf_litter,acid-soluble_below_ground_woody_litter,water-soluble_below_ground_leaf_litter,water-soluble_below_ground_woody_litter,ethanol-soluble_below_ground_leaf_litter,ethanol-soluble_below_ground_woody_litter,non-soluble_below_ground_leaf_litter,non-soluble_below_ground_woody_litter,humus_from_leaf_litter,humus_from_woody_litter +CHAR_AXIS_LANDUSE=primary_and_secondary_land,crops,pastures,urban +CHAR_AXIS_BASIN=global_ocean,atlantic_arctic_ocean,indian_pacific_ocean +CHAR_AXIS_OLINE=barents_opening,bering_strait,canadian_archipelago,denmark_strait,drake_passage,english_channel,pacific_equatorial_undercurrent,faroe_scotland_channel,florida_bahamas_strait,fram_strait,iceland_faroe_channel,indonesian_throughflow,mozambique_channel,taiwan_luzon_straits,windward_passage +CHAR_AXIS_SILINE=barents_opening,bering_strait,canadian_archipelago,fram_strait +#spectband for the 3 aeropt variables +CHAR_AXIS_SPECTBAND_aeroptbnd=1818182 +CHAR_AXIS_SPECTBAND_aeroptbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aeroptbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerssabnd=1818182 +CHAR_AXIS_SPECTBAND_aerssabnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerssabnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_aerasymbnd=1818182 +CHAR_AXIS_SPECTBAND_aerasymbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_aerasymbnd_UNITS="m-1" +# 2d-spectband for the albedos +CHAR_AXIS_SPECTBAND_albdirbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdirbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdirbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_albdiffbnd=3225689,766690 +CHAR_AXIS_SPECTBAND_albdiffbnd_BOUNDS=5000000,1451379,1451379,82001 +CHAR_AXIS_SPECTBAND_albdiffbnd_UNITS="m-1" +CHAR_AXIS_SPECTBAND_solbnd=1818182 +CHAR_AXIS_SPECTBAND_solbnd_BOUNDS=2262443,1600000 +CHAR_AXIS_SPECTBAND_solbnd_UNITS="m-1" +#T_AXIS="cmip" causes the time axis to be rewritten according to the requested time stamps +T_AXIS="cmip" +#OUTPUT_MODE="r" +OUTPUT_MODE="a" +MAX_SIZE=0 +SAVE_CHUNK="n" +#For files without time axis, if one is requested: +#firsttimeval=1 (1850-01-02 00:00:00 wenn days since 1850-01-01 00:00:00) +FIRSTTIMEVAL=1 +# +# institution and contact info: +# +# none of these can be set in the command line +# +DEFLATE_LEVEL=1 +CONTACT=palmod2-mpi-esm@dkrz.de +# +# MPI-M +# +INSTITUTION_ID=MPI-M +INSTITUTION="Max Planck Institute for Meteorology, Hamburg 20146, Germany" +LICENSE="PalMod2 model data produced by MPI-M is licensed under a Creative Commons Attribution ShareAlike 4.0 International License (https://creativecommons.org/licenses). The data producers and data providers make no warranty, either express or implied, including, but not limited to, warranties of merchantability and fitness for a particular purpose. All liabilities arising from the supply of the information (including any liability arising in negligence) are excluded to the fullest extent permitted by law." +#MIP_TABLE_DIR="/pool/data/CMIP6/cmip6-cmor-tables/Tables/" +MIP_TABLE_DIR="/work/bm0021/PalMod2/cmor_tables/" diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.cmor_ctl b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.cmor_ctl index e99464493038a940f202c10179e77a810e8d239e..8660427cb408229db6970d5a72c4f56a7d20ed9b 100755 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.cmor_ctl +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.cmor_ctl @@ -12,7 +12,7 @@ n_subsim=4 spinup=1000 iniyeararr=( $((4000+spinup)) 2000 2000 2000 ) finyeararr=( 8999 8999 8999 8999 ) -iniyearoffset=1000 +iniyearoffset=0 iniyear=$(( 1 + $iniyearoffset + $spinup )) finyear=$(( 26000 + $iniyearoffset - $spinup )) #offset compared to startyear @@ -27,7 +27,7 @@ inioffsetarr=( $(( -3999 + $iniyearoffset )) $(( 3001 + $iniyearoffset )) $(( 10 # Chunksize # Note that there are prerequisites concerning the chunksize: # - the defined decadal timeslizes may not overlap between two chunks! -# - decadal bounds have to be defined accordingly - "???01231" in this case +# - decadal bounds have to be defined accordingly - "???01231" in this case # - usually this is the case by default due to decadal model output! chunksize=100 diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.runpp b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.runpp index 837de5affa5706759b0d554ca94ad4c1f7804124..c62b05758347ea64101f25ec3d73862a63f7f351 100755 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.runpp +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR.runpp @@ -43,7 +43,7 @@ alias ncatted=/sw/spack-levante/nco-5.0.6-3xkdth/bin/ncatted ######################################### #Root directory of all scripts, outdata, logs etc -EXP_ID=transient-deglaciation-prescribed-glac1d_r1i1p4f2-CR +EXP_ID=transient-deglaciation-interactive_r1i1p4f2-CR #EXP_DIR_TRUNK=/work/bk1192/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p4f2-CR EXP_DIR_TRUNK=/work/kd1292/ESGF_Buff/k204212/palmod_CS/transient-deglaciation-interactive_r1i1p4f2-CR @@ -135,7 +135,7 @@ ca+=([vilma]="${SCRIPT_ROOT}/cdocmorinfo_vilma_CR") experiment=transient-deglaciation-interactive member=r1i1p4f2 mip=PalMod2 -vd=v20240920 +vd=v20250105 #vd=v$(date '+%Y%m%d') #CMOR version directory name, should be a date in format YYYYMMDD #Where to store errors @@ -388,7 +388,7 @@ function run_agg fi # Perform aggregation for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) @@ -416,7 +416,7 @@ function run_agg sdir=${SDIR[$y]}/outdata/$submodel rawsdir=${RAWSDIR[$y]}/outdata/$submodel rawsdir_pism_ant=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_ANT - rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH + rawsdir_pism_nh=$(echo $rawsdir | rev | cut -d "/" -f 3- | rev)/PISM_NH echo "... writing output to $sdir/out_aggr" echo "... writing log to $errtemp_agg" @@ -478,7 +478,7 @@ function run_diag rm -f ${err}* # Perform diagnostic for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) @@ -585,7 +585,7 @@ function run_cmor rm -f ${err}* # Perform CMOR rewrite for each submodel - for submodel in $slmod; do #$icemod $slmod $atmmod $ocemod $srfmod; do + for submodel in $icemod $slmod $atmmod $ocemod $srfmod; do if [[ "$submodel" == "$icemod" ]]; then period=$(( inv_chunk_year - 10 )) diff --git a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR_cdocmorinfo b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR_cdocmorinfo index fb321e46bd96c79e3ab33972cde65354a1bc6419..38c99be5899cf594741ab95d9564c46540e1ebfe 100644 --- a/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR_cdocmorinfo +++ b/cmor/mpiesm/scripts/transient-deglaciation-interactive_r1i1p4f2-CR_cdocmorinfo @@ -16,10 +16,10 @@ REALIZATION_INDEX=1 INITIALIZATION_INDEX=1 PHYSICS_INDEX=4 FORCING_INDEX=2 -VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. The simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024). GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." +VARIANT_INFO="The data are from a synchronously coupled model simulation of the last deglaciation with the MPI-ESM1.2.1-CR-mPISM-VILMA setup, hence, including interactive ice sheets and solid earth components. Equivalent to p1 but with retuned atmosphere as well as modified sea-ice rigidity, ocean mixing, and basal sliding parameters. In addition, the simulation was forced with time-varying volcanic forcing (Schindlbeck-Belo et al., 2024). GHG forcing is after Koehler et al. (2017), Orbit after Berger (1978)." COMMENT="Earth viscosity configuration for the solid earth model VILMA. The vertical viscosity structure is piecewise constant for the following specified layers of the earth: (1) 0 to 3.480000e+06 m from earth core: 1.000000e+19 Pa s. (2) 3.480000e+06 to 5.701000e+06 m from earth core: 1.000000e+22 Pa s. (3) 5.701000e+06 to 6.291000e+06 m from earth core: 4.000000e+20 Pa s. (4) 6.291000e+06 to 6.371000e+06 m from earth core: 1.000000e+30 Pa s." ACTIVITY_ID=PalMod2 -#MIP_ERA=PalMod2 #ONLY CMIP6 +#MIP_ERA=PalMod2 #ONLY CMIP6 PROJECT_ID=PalMod2 REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" #FURTHER_INFO_URL="https://furtherinfo.es-doc.org/<mip_era>.<institution_id>.<source_id>.<experiment_id>.<sub_experiment_id>.<variant_label> @@ -28,7 +28,7 @@ REQUIRED_TIME_UNITS="days since 1-1-1 00:00:00" # else use BRANCH_DATES to give the dates in YYYYMMDD,YYYYMMDD format #BRANCH_TIME_IN_PARENT= #BRANCH_TIME_IN_CHILD= -#BRANCH_DATES=19000101,18500101 +#BRANCH_DATES=19000101,18500101 #BRANCH_METHOD="standard" #PARENT_MIP_ERA=none #ONLY CMIP6 #PARENT_ACTIVITY_ID=none @@ -45,7 +45,7 @@ SUB_EXPERIMENT=none # SOURCE_ID=MPI-ESM1-2-1-CR #MODEL_ID=MPI-ESM1-2-1-CR -REFERENCES="The paper ist currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" +REFERENCES="The paper is currently in open discussion under the following citation:\nMikolajewicz, U., Kapsch, M.-L., Schannwell, C., Six, K. D., Ziemen, F. A., Bagge, M., Baudouin, J.-P., Erokhina, O., Gayler, V., Klemann, V., Meccia, V. L., Mouchet, A., and Riddick, T.: Deglaciation and abrupt events in a coupled comprehensive atmosphere–ocean–ice sheet–solid earth model, Clim. Past Discuss. [preprint], https://doi.org/10.5194/cp-2024-55, in review, 2024" SOURCE="MPI-ESM1.2.1-CR (2022): \naerosol: none, prescribed Kinne (2010)\natmos: ECHAM6.3 (spectral T31; 96 x 48 longitude/latitude; 31 levels; top level 10 hPa)\natmosChem: none, prescribed\nland: JSBACH3.20, River Transport Model\nlandIce: none / mPISM 0.7 (10 km x 10 km (NH), 15 km x 15 km (SH), 121 levels)\nocean: MPIOM1.63 (bipolar GR3.0, approximately 300km; 122 x 101 longitude/latitude; 40 levels; top grid cell 0-15 m)\nocnBgchem: none, prescribed\nseaIce: unnamed (thermodynamic (Semtner zero-layer) dynamic (Hibler 79) sea ice model)\nsolidLand: none / VILMA-1D" SOURCE_TYPE="AOGCM ISM SLM" #CALENDAR=proleptic_gregorian