;
; Macros definitions (leave blanks around each code)
;
; [ ]macro[ = ]sign_1[ ]field_1[ ].... [ ]<legend>[ ][unit]
;  or
; [ ]macro[ =: ]<name of idl function to call>[ ]<legend>[ ][unit]

; WORK

 soellips =: make_work <Ellipse> [-]

; HADAM
 totprep =  lsrain + lssnow + cvrain + cvsnow   <E-P>    [kg m-2 s-1]
 -e-mp =  evap - lsrain - lssnow - cvrain - cvsnow   <E-P>    [kg m-2 s-1]
 nrads = solar + longwave - sh - 2.501e6 * evap <Net surface heat flux> [W m-2]
 toabud =  field200 - field201 - olr <Net Radiation at TOA> [W m-2]
 totcld = field31 + field32 + field33 <Total Could Amount> [ ]

; ECHAM4
 -e-mp =  - evap - tprep		<E-P>         [m/s]
 e-mp =  - qevap - aprl - aprc - aprs		<E-P>         [m/s]
 emp =  - evap - tprc		<E-P>         [m/s]
 -n-rads = ahfs + ahfl + srads + trads <Net surface heat flux> [W/m**2]
 curltau =: make_curltau <Wind Stress Curl> [N/m]

; OPA
 vozonbsf =: make_msf  <Meridional Stream Function> [Sv]
 votkeavt =: make_votkeavt <Vertical Eddy Diffusivity> [m2/s]
 vodenpot =: make_eos <Potential Density> [kg/m3]
 vocrtmod =: make_crtm  <Current Module> [m/s]
 vovem300 =: make_vem300 <Mean Vertical Velocity 300 m> [m/s]
 vozom300 =: make_zom300 <Mean Zonal Velocity 300 m> [m/s]
 vomem300 =: make_mem300 <Mean Meridional Velocity 300 m> [m/s]

 vodeptht  =: make_depth <Depth> [m]
 vosigthi  =: make_depth <Sigma Thickness> [m]
 vosigvol  =: make_depth <Sigma Volume> [m3]

 vozotrax =: make_xtran <Zonal Transport> [Sv]
 vometray =: make_ytran <Meridional Transport> [Sv]
 vovetraz =: make_ztran <Vertical Transport> [Sv]

 tsA =: make_anomaly < Skin temperature anomaly > [Kelvin] \ts/

; GRADIENTS

 sosstgrady =: make_grad <Meridional SST Gradients> [C.(100km)-1] \sosstsst, y/
 sosstgradx =: make_grad <Zonal SST Gradients> [C.(100km)-1] \sosstsst, x/
 tauxgradx =: make_grad <Zonal Taux Gradients> [Pa.(m)-1] \sozotaux, x/
 tauxgrady =: make_grad <Meridional Taux Gradients> [Pa.(m)-1] \sozotaux, y/
 tsolgrady =: make_grad <Meridional TSOL Gradients> [C.(100km)-1] \tsol, y/
 tsolgradx =: make_grad <Zonal TSOL Gradients> [C.(100km)-1] \tsol, x/
 icecovgrady =: make_grad <Zonal ICECOV Gradients> [No units] \soicecov, y/

; RATIO

 ratiotaux =:  make_ratio <Ratio> [no units] \taux, ztauxx_SCi, ztemp_taux, ztauxx_SCi/
 ratiotauy =:  make_ratio <Ratio> [no units] \tauy, ztauyy_SCi, ztemp_tauy, ztauyy_SCi/
 ratiosflx =:  make_ratio <Ratio> [no units] \soshfoce_m, soshfoce_SCi, temp_soshfoce, soshfoce_SCi/
 rationsflx =: make_ratio <Ratio> [no units] \sonsfoce_m, sonsfoce_SCi, temp_sonsfoce, sonsfoce_SCi/

; LINEAR INTERP

 tauxSCi =: make_interp <Interp> [Nm-2] \ztauxx_SCa, 0.533333, ztauxx_SCb, 0.466667/
 tauySCi =: make_interp <Interp> [Nm-2] \ztauyy_SCa, 0.533333, ztauyy_SCb, 0.466667/
 sohefoce-f-m =: make_interp <Interp> [Wm-2] \sohefldo_f, 1.0, sonsfoce_m, -1.0, soshfoce_m, -1.0/
 sonsfoce-f-m =: make_interp <Interp> [Wm-2] \sohefldo_f, 1.0, soshfldo_f, -1.0, sonsfoce_m, -1.0/
 soshfoce-f-m =: make_interp <Interp> [Wm-2] \soshfldo_f, 1.0, soshfoce_m, -1.0/

; CDH4 HEAT FLUX
 nshfs = soll + lat_oce + sens <Net Down Non Solar Heat Flux at Surf>  [Wm-2]
 shfs =  sols  <Net Down Solar Heat Flux at Surf> [W/m2]
 thfs = soll + lat_oce + sens + sols <Net Down Total Heat Flux at Surf>  [Wm-2]
 
; ERA40 HEAT FLUX
 nshfs = str + slhf + sshf <Net Down Non Solar Heat Flux at Surf>  [Wm-2]
 shfs =  ssr  <Net Down Solar Heat Flux at Surf> [W/m2]
 thfs = ssr + str + slhf + sshf <Net Down Total Heat Flux at Surf>  [Wm-2]

; NCEP HEAT FLUX
 nshf# =  nlwrs + lhtfl + shtfl <Net Down Non Solar Heat Flux at Surf>  [W/m2]
 shf# =   nswrs  <Net Down Solar Heat Flux at Surf> [W/m2]
 thf# =   nswrs + nlwrs + lhtfl + shtfl  <Net Down Total Heat Flux at Surf>  [W/m2]

; for stats, add a \field/ = base field to work on

; Deviation Standard
 sstdev =: make_stddev <SST Std Dev> [C] \sst/
 sosstdev =: make_stddev <SST Std Dev> [C] \sosstsst/
 votdev =: make_stddev <Votemper Std Dev> [C] \votemper/
 tsoldev =: make_stddev <TSOL Std Dev> [C] \tsol/
 airdev =: make_stddev <Air Temp Std Dev> [C] \air/ 
 sotoxdev =: make_stddev <TAUX Oce Std Dev> [Nm-2] \sozotaux/
 toxdev =: make_stddev <TAUX Atm Std Dev> [Nm-2] \taux_oce/
 ztxdev =: make_stddev <TAUX Oce Std Dev> [Nm-2] \ztx/
 sotoydev =: make_stddev <TAUY Oce Std Dev> [Nm-2] \sometauy/
 toydev =:  make_stddev <TAUY Atm Std Dev> [Nm-2] \tauy_oce/
 mtydev =: make_stddev <TAUY Oce Std Dev> [Nm-2] \mty/
 tempdev =: make_stddev <SST Std Dev> [C] \temp/
 tsdev =: make_stddev <SST Std Dev> [C] \ts/
 tosdev =: make_stddev <SST Std Dev> [C] \tos/
 tasdev =: make_stddev <TAS Std Dev> [C] \tas/
 tadev =: make_stddev <TA Std Dev> [C] \ta/
 tauudev =: make_stddev <TAUX Std Dev> [Pa] \tauu/
 tauvdev =: make_stddev <TAUY Std Dev> [Pa] \tauv/
 srftdev =: make_stddev <Surf. Temp. Std Deviation> [K] \srft/
 airdev =: make_stddev <Air Temp Std Dev> [C] \air/
 uflxdev =: make_stddev <Taux Std Dev> [Nm-2] \uflx/
 vflxdev =: make_stddev <Tauy Std Dev> [Nm-2] \vflx/
 nshfsdev =: make_stddev <Net Down Non Solar Heat Flx Std Dev> [Wm-2] \nshfs/
 shfsdev =: make_stddev <Net Down Solar Heat Flx Std Dev> [Wm-2] \shfs/
 swdev =: make_stddev <SW net SFC Std Dev> [Wm-2] \SWsfc/
 lwdev =: make_stddev <LW net SFC Std Dev> [Wm-2] \LWsfc/
 bilsdev =: make_stddev <Surf Total Heat Flx Std Dev> [Wm-2] \bils/
 thfsdev =: make_stddev <Net Down Total Heat Flx Std Dev> [Wm-2] \thfs/
 sohefldodev =: make_stddev <Net Downwd Heat Flx Std Dev> [Wm-2] \sohefldo/
 sonsfldodev =: make_stddev <Non Solar Heat Flx Std Dev> [Wm-2] \sonsfldo/
 soshfldodev =: make_stddev <Solar Heat Flx Std Dev> [Wm-2] \soshfldo/
 precipdev =: make_stddev <Precip Std Dev> [mm(day-1)] \precip/
 pcpdev =: make_stddev <Precipitations Std Dev> [mm(day-1)] \pcp/ 
 topldev =: make_stddev <OLR Std Dev> [Wm-2] \topl/

; Kurtosis et Skewness
 sosstskew  =: make_skewness <SST Skewness> [C] \sosstsst/
 sosstkurt  =: make_kurtosis <SST Kurtosis> [C] \sosstsst/
 tsskew  =: make_skewness <SST Skewness> [C] \ts/
 tasskew  =: make_skewness <SST Skewness> [C] \tas/
 tauuskew  =: make_skewness <TAUX Atm Skewness> [C] \tauu/
 tauvskew  =: make_skewness <TAUY Atm Skewness> [C] \tauv/
 tauxskew  =: make_skewness <TAUX Oce Skewness> [C] \sozotaux/
 tauyskew  =: make_skewness <TAUY Oce Skewness> [C] \sometauy/

; Ocean

 sowincur =: make_wcurl  <Wind Stress Curl> [N/m]
 sowindiv =: make_wdiv  <Wind Stress Divergence> [N/m]
 sowinmod =: make_wm  <Wind Stress Module> [N/m2]
 so20cdep =: make_20C  <Depth of 20C Isotherm> [m]
 sobarstf =: make_bsf  <Barotropic Stream Function> [Sv]

 sodenflx =: make_denflx  <Density Flux> [kg/m2/s]
 sodenflw =: make_denflw  <Fresh Water Density Flux> [kg/m2/s]

 sonsfldo = sohefldo - soshfldo <Non Solar Heat Flux> [W/m2]
 sohefatm = sohefldo - sohefldp <Downward Heat Flux Atmos> [W/m2]
 sowatatm = sowaflup - sowafldp <Upward Water Flux Atmos> [Kg/m2/s]
 sohefcmp = q        - qrp      <Net Downward Heat Flux> [W/M2]

 sozonfht = sozonfha + sozonfhd <Total Heat Transport> [PW] 
 sozanfht = sozanfha + sozanfhd <Atlantic Total Heat Transport> [PW] 
 sozonfst = sozonfsa + sozonfsd <Total Salt Transport> [Giga.g/s]
 sozanfst = sozanfsa + sozanfsd <Atlantic Total Salt Transport> [Giga.g/s]
 sozdnfht = sozonfha + sozonfhd - sozanfha - sozanfhd <Indopac Total Heat Transport> [PW]
 sozdnfhg = sozonfhg - sozanfhg <Indopac Gyre Heat Transport> [PW] 
 sozdnfho = sozonfho - sozanfho <Indopac Overturning Heat Transport> [PW] 
 sozdnfhd = sozonfhd - sozanfhd <Indopac Diffusive Heat Transport> [PW] 
 sozdnfst = sozonfsa + sozonfsd - sozanfsa - sozanfsd <Indopac Total Salt Transport> [Giga.g/s] 
 sozdnfsg = sozonfsg - sozanfsg <Indopac Gyre Salt Transport> [PW] 
 sozdnfso = sozonfso - sozanfso <Indopac Overturning Salt Transport> [PW] 
 sozdnfsd = sozonfsd - sozanfsd <Indopac Diffusive Salt Transport> [PW] 

 somltten = somlbtdz + somlbtdt + somlbtdv <T Total Vertical Entrainment> [C/s]
 somlttis = somlttdh + somlbtdv <T Total Isopycnal Diffusion> [C/s]
 somlttah = somlttax + somlttay  <T Horizontal Advection> [C/s]
 somlttad = somlttax + somlttay + somlttaz  <T Total Advection> [C/s]
 somltsen = somlbsdz + somlbsdt + somlbsdv <S Total Vertical Entrainment> [PSU/s]
 somltsis = somltsdh + somlbsdv <T Total Isopycnal Diffusion> [PSU/s]
 somltsah = somltsax + somltsay  <S Horizontal Advection> [PSU/s]
 somltsad = somltsax + somltsay + somltsaz  <S Total Advection> [PSU/s]

; ECMWF
 soheflec = ecmwf_146 + ecmwf_147 + ecmwf_176 + ecmwf_177 <Net Downward Heat Flux> [Wm-2]
 soshflec = ecmwf_176 <Solar Heat Flux> [Wm-2]
 sonsflec = ecmwf_146 + ecmwf_147 + ecmwf_177 <Non Solar Heat Flux> [Wm-2]
 sowaflec = ecmwf_182 + ecmwf_142 + ecmwf_143 <E-P> [mmj-1]

; LMDZ
 uwf = evap - rain <E-P> [mm/day]
 latent = bils - sens <Latent Heat Flux Atm> [Wm-2]

