ohc 0-100
Hi @jvegas
I independently calculated ohc 0-100 m for 1 file in a2i9 (here /esarchive/scratch/eexarcho/Eleftheria/PRIMAVERA/WP2/ORAS4_ohc/calc_ohc0-100-test-a2i9.sh
) and compared it to the earthdiagnostics output
/esarchive/exp/ecearth/a2i9/diags/DCPP/EC-Earth-Consortium/EC-Earth3/dcppA-hindcast/r1i1p1f1/Omon/heatc0-100m/r360x180/v20200122
and I got different results
I am wondering what might have been wrong...
my calculation is
tmpdir=/esarchive/scratch/eexarcho/Eleftheria/PRIMAVERA/WP2/ORAS4_ohc/meshmask/
tmask=${tmpdir}/tmask.nc
tmask1=${tmpdir}/tmask1.nc
indir=/esarchive/exp/ecearth/a2i9/cmorfiles/DCPP/EC-Earth-Consortium/EC-Earth3/dcppA-hindcast/r1i1p1f1/Omon/thetao/gn/v20200122/
infile=${indir}/thetao_Omon_EC-Earth3_dcppA-hindcast_s1980-r1i1p1f1_gn_198006-198101.nc
fileout=ohc0-100_Omon_EC-Earth3_dcppA-hindcast_s1980-r1i1p1f1_gn_198006-198101.nc
cdo selvar,thetao $infile tmp1.nc
cdo ifthen $tmask tmp1.nc tmp2.nc
cdo -addc,273.15 tmp2.nc tmp3.nc
ncrename -O -v thetao,ohc tmp3.nc
cdo mul tmp3.nc ${tmpdir}/e3tfile.nc tmp4.nc
cdo setzaxis,${tmpdir}/lev.asc tmp4.nc tmp5.nc
ncks -O -d depth,0.0,100.0 tmp5.nc tmp6.nc
cdo mulc,4082793 tmp6.nc tmp7.nc
cdo vertsum tmp7.nc tmp8.nc
cdo ifthen ${tmpdir}/tmask1.nc tmp8.nc $fileout
var=ohc
units='J/m2'
long_name='ocean heat content integrated between 0-100 m'
# long name
ncatted -O -a long_name,${var},c,c,"${long_name}" $fileout
# units
ncatted -O -a units,${var},c,c,"${units}" $fileout
which is pretty simple. Perhaps we use different volumetric heat capacity cp (cp=4082793 above)?