Project

General

Profile

chaining operators

Added by Safaa Naffaa almost 3 years ago

I am calculating C factor by using the following equation:

C factor =1, coverfraction= 0
C factor =-0.083 xlg(coverfraction) + 0.417, 0 < coverfraction < 78.3%,
C factor= 0, coverfraction > 78.3%,

I want to apply the conditions for coverfraction in my code and apply the log equation to the values that are less than 0 and more than 78.3%. for values that are 0 I want to have a cfactor.nc that is equal to 1 and for values that are more than 78.3% I want to have a cfactor.nc that is equal to 0. How can I do that? Thank you in advance

The code is:

echo "Log: " $gc_ofile

cdo -O -L -log inputfile.nc ofilelog.nc
cdo -O -L "-mulc,-0.083" outputlogfile.nc ofilemulti.nc
cdo -O -L "-addc,0.417" ofilemulti.nc cfactor.nc