Commit 13953473 authored by dumoda01's avatar dumoda01
Browse files

Modification du script SCM_analysis.jnl

parent 0cd08a07
! NOAA/PMEL TMAP
! FERRET v6.62
! Linux(gfortran) 2.6.9-89.0.20.ELsmp - 06/11/10
! 7-Feb-11 11:11
use amdgulf
!Variables definition.
define symbol D=18-jun-2008
define symbol per_day=(24/3)
define symbol alpha=0.11
define symbol inib=0.001
define symbol vp=0.3
define symbol p0=0.0001
define symbol k1=0.5
define symbol k2=0.2
define symbol C_mg_mmol=12.001
define symbol N_mg_mmol=14.007
define symbol C_N=(8.82/(($C_mg_mmol)/($N_mg_mmol)))
define symbol N_mmol_Chla=(15.54/($N_mg_mmol))
define symbol area=450000*1000^2
define symbol tera=10^12
!Find the maximum concentration of phy (if excluding the accumulation in the bottom layer; k=6:80)
let max_phy=phy[z=@max]
list/clobber/file=max_phy max_phy
!plot max_phy
!frame/file=phy_concentration_SCM.gif
!Phy concentration normalized (between 0 and 1). To assess the presence of a SCM, it could be usefull to normalized phy in order to remove the effect of changes in the concentration troughout the season.
let norm_phy=phy/max_phy
!fill norm_phy[k=6:80]
!frame/file=norm_phy.gif
!Determination of the depth of the SCM.
let depth_SCM=norm_phy[z=@loc:1]
list/clobber/file=scm_depth depth_SCM
plot depth_SCM
frame/file=depth_SCM.gif
!Determination of the nitracline.
let d_nit=nit[k=1:80@ddc]
let nitracline=d_nit[k=40:80@loc:-0.01]
fill/key=continuous/levels=(0,15,0.1) nit
contour/overplot/level=(-0.04) d_nit[k=50:80]
contour/overplot/level=(-0.15) d_nit[k=50:80]
contour/over/color=green/level=(1.51) nit
frame/file=Nitrate.gif
fill amm[k=10:80]
frame/file=Ammonium.gif
!The centered derivative of phy (excluding the accumulation in the bottom layer; k=6:80@ddc).
let d_phy=phy[k=6:80@ddc]
!The centered derivative of normalized phy (excluding the accumulation in the bottom layer; k=6:80@ddc).
let d_norm_phy=norm_phy[k=6:80@ddc]
!Absolute values of d_phy and d_norm_phy. To avoid "s" profiles.
let abs_d_phy=abs(d_phy)
let abs_d_norm_phy=abs(d_norm_phy)
!plot /T=($D) abs_d_norm_phy
!frame/file=Derivative_of_normalized_phy_absolute.gif
!Smooth of of abs_d_phy to include norm_phy EQ 1.
let smooth_abs_d_phy=abs_d_phy[k=6:80@sbx:8]
let smooth_abs_d_norm_phy=abs_d_norm_phy[k=6:80@sbx:8]
!Graph of phytoplankton, SCM and nitracline depths and definition of the SCM zone.
let good_locations=phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.01
let good_locations2=phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.005
let good_locations_norm=phy[k=6:80] GE 0.1 and smooth_abs_d_norm_phy[k=6:80] GE 0.015
!fill /level=(0,1,0.5) /pal=grayscale good_locations[k=40:80]
!contour/overplot norm_phy EQ 1
!frame/file=Good_locations.gif
!Phytoplankton mmol N m-3
fill /key=continuous/pal=no_red/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 phy
!plot/vs/over/thick=3/dash(0.1,0.1,0.1,0.1)/color=red depth_SCM
!SCM depth
contour/overplot/levels=(0.995) norm_phy[t=10-jun-2008:20-oct-2008]
!Nitracline depth
contour/overplot/level=(-0.15) d_nit[k=50:80]
contour/overplot/level=(1.0) nit
!Contour SCM.
!contour/overlay/color=red/levels=(0.015) smooth_abs_d_phy
contour/over/nolabel/color=purple/level=(0.5) good_locations
contour/over/nolabel/color=white/level=(0.5) good_locations2
frame/file=phytoplankton_mmol_N_m-3.gif
!Phytoplankton ug chla l-1.
let Chla_phy=phy/($N_mmol_Chla)
fill /key=continuous/levels=(-3.4,1.0,0.04)/pal=no_red/nolabel/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 log(Chla_phy)
!SCM depth
!contour/overplot/levels=(0.995) norm_phy[t=10-jun-2008:20-oct-2008]
!Nitracline depth
!contour/overplot/level=(-0.02) d_nit[k=50:80]
!contour/overplot/level=(1.0) nit
!Contour SCM.
!contour/overlay/color=red/levels=(0.015) smooth_abs_d_phy
!contour/over/nolabel/color=purple/level=(0.5) good_locations
!contour/over/nolabel/color=white/level=(0.5) good_locations2
frame/file=phytoplankton_chla_ug_l.gif
plot /t=($D) phy
plot/overlay /t=($D)/hlimts=-100 phy[k=6:80] GE 0.2 and smooth_abs_d_phy[k=6:80] GE 0.01
!plot/overlay /t=($D) phy[k=6:80] GE 0.1 and smooth_abs_d_norm_phy[k=6:80] GE 0.015
frame/file=phy_daily.gif
!Define the primary production.
!Define Ps.
define symbol ps=($vp)/((($alpha)/(($alpha)+($inib)))*(($inib)/(($alpha)+($inib))))^(($inib)/($alpha))
!Define the photosynthesis equation.(Platt 1980)
let p=($ps)*(1-exp(-1*($alpha)*par/($ps)))*exp(-1*($inib)*par/($ps))
!Define the primary production, total, new, regenerated and f-ratio.
let new_prod=p*(phy+($p0))*(nit/(($k1)*(1+(nit/($k1))+(amm/($k2)))))
let reg_prod=p*(phy+($p0))*(amm/(($k2)*(1+(nit/($k1))+(amm/($k2)))))
let tot_prod = new_prod + reg_prod
let f_ratio = new_prod[l=1:2920@sbx:8]/tot_prod[l=1:2920@sbx:8]
!Graphs for the primary production.
fill/key=continuous/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 new_prod[l=1:2920@sbx:8]
!contour/overplot/levels=(0.995) norm_phy[t=10-jun-2008:20-oct-2008]
!contour/over/nolabel/color=black/level=(0.5) good_locations
frame/file=new_prod.gif
fill/key=continuous/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 reg_prod[l=1:2920@sbx:8]
!contour/overplot/levels=(0.995) norm_phy[t=10-jun-2008:20-oct-2008]
!contour/over/nolabel/color=black/level=(0.5) good_locations
frame/file=reg_prod.gif
fill/key=continuous/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 tot_prod[l=1:2920@sbx:8]
!contour/overplot/levels=(0.995) norm_phy[t=10-jun-2008:20-oct-2008]
!contour/over/nolabel/color=black/level=(0.5) good_locations
frame/file=tot_prod.gif
fill/key=continuous/vlimits=-100:-0.1/hlimits=1-jan-2008:31-dec-2008 f_ratio
!contour/overplot/levels=(0.999) norm_phy[t=10-jun-2008:20-oct-2008]
!contour/over/nolabel/color=black/level=(0.5) good_locations
frame/file=f_ratio.gif
!fill par
!frame/file=par.gif
!Definition of the primary production at the SCM.
let SCM_prod=tot_prod*good_locations
let SCM_new_prod=new_prod*good_locations
let SCM_reg_prod=reg_prod*good_locations
!fill SCM_prod
!frame/file=PP_at_the_SCM.gif
let i_prod=tot_prod[k=6:80@sum]
let i_new_prod=new_prod[k=6:80@sum]
let i_reg_prod=reg_prod[k=6:80@sum]
let i_SCM_prod=SCM_prod[k=6:80@sum]
let i_SCM_new_prod=SCM_new_prod[k=6:80@sum]
let i_SCM_reg_prod=SCM_reg_prod[k=6:80@sum]
!f-ratio au SCM.
let SCM_fratio=SCM_new_prod[k=6:80]/SCM_prod[k=6:80]
let mean_SCM_fratio=SCM_fratio[k=6:80@ave]
plot/thick=2/nolabel f_ratio[k=40:80@ave]
plot/overlay/thick=2/nolabel mean_SCM_fratio
frame/file=f-ratio_at_SCM.gif
!list mean_SCM_fratio[l=1:2920@max]
!list mean_SCM_fratio[l=1:2920@min]
!list mean_SCM_fratio[l=1:2920@ave]
!Ratio PP at the SCM over total PP in the water column.
let PP_ratio=i_SCM_prod[l=1:2920@sbx:8]/i_prod[l=1:2920@sbx:8]
let PP_new_ratio=i_SCM_new_prod[l=1:2920@sbx:8]/i_new_prod[l=1:2920@sbx:8]
let PP_reg_ratio=i_SCM_reg_prod[l=1:2920@sbx:8]/i_reg_prod[l=1:2920@sbx:8]
!Integrated primary production and contribution of the SCM with hourly mean radiative fluxes.
plot/thick=2/vlimits=0:6.0/hlimit=1-jan-2008:31-dec-2008/nolabel i_prod[l=1:2920@sbx:8]
plot/overlay/thick=2/nolabel i_SCM_prod[l=1:2920@sbx:8]
plot/over/thick=2/dash(0.1,0.1,0.1,0.1)/nolabel 6.0*PP_ratio
frame/file=Integrated_PP.gif
plot/thick=2/vlimits=0:6.0/nolabel i_new_prod[l=1:2920@sbx:8]
plot/overlay/thick=2/nolabel i_SCM_new_prod[l=1:2920@sbx:8]
plot/overlay/thick=2/dash=(0.1,0.1,0.1,0.1)/nolabel 6.0*PP_new_ratio
frame/file=Integrated_PP_new.gif
plot/thick=2/vlimit=0:2.0/nolabel i_reg_prod[l=1:2920@sbx:8]
plot/overlay/thick=2/nolabel i_SCM_reg_prod[l=1:2920@sbx:8]
plot/overlay/thick=2/dash=(0.1,0.1,0.1,0.1)/nolabel 2.0*PP_reg_ratio
frame/file=Integrated_PP_reg.gif
!Integrated primary production and contribution of the SCM with daily mean radiative fluxes.
!plot i_prod
!plot/overlay i_SCM_prod
!plot/overlay PP_ratio
!frame/file=Integrated_PP.gif
!plot i_new_prod
!plot/overlay i_SCM_new_prod
!plot/overlay PP_new_ratio
!frame/file=Integrated_PP_new.gif
!plot i_reg_prod
!plot/overlay i_SCM_reg_prod
!plot/overlay PP_reg_ratio
!frame/file=Integrated_PP_reg.gif
!Annual primary production.
let annual_PP=i_prod[l=1:2920@sum]/($per_day)
let SCM_annual_PP=i_SCM_prod[l=1:2920@sum]/($per_day)
let contribution_of_SCM_at_annual_PP=SCM_annual_PP/annual_PP*100
!list annual_PP
!list SCM_annual_PP
!list contribution_of_SCM_at_annual_PP
!Annual new primary production.
let annual_PP_new=i_new_prod[l=1:2920@sum]/($per_day)
let SCM_annual_PP_new=i_SCM_new_prod[l=1:2920@sum]/($per_day)
let contribution_of_SCM_at_annual_PP_new=SCM_annual_PP_new/annual_PP_new*100
!list annual_PP_new
!list SCM_annual_PP_new
!list contribution_of_SCM_at_annual_PP_new
!Annual regenerated primary production.
let annual_PP_reg=i_reg_prod[l=1:2920@sum]/($per_day)
let SCM_annual_PP_reg=i_SCM_reg_prod[l=1:2920@sum]/($per_day)
let contribution_of_SCM_at_annual_PP_reg=SCM_annual_PP_reg/annual_PP_reg*100
!list annual_PP_reg
!list SCM_annual_PP_reg
!list contribution_of_SCM_at_annual_PP_reg
!Convert the N annual primary production to C annual primary production.
!To mmol N m-2 y-1 to mmol C m-2 y-1.
let C_annual_PP=annual_PP*($C_N)
let C_annual_PP_new=annual_PP_new*($C_N)
let C_annual_PP_reg=annual_PP_reg*($C_N)
let C_SCM_annual_PP=SCM_annual_PP*($C_N)
let C_SCM_annual_PP_new=SCM_annual_PP_new*($C_N)
let C_SCM_annual_PP_reg=SCM_annual_PP_reg*($C_N)
!To mmol C m-2 y-1 to g C m-2 y-1
let C_annual_PP_g=C_annual_PP*($C_mg_mmol)/1000
let C_annual_PP_new_g=C_annual_PP_new*($C_mg_mmol)/1000
let C_annual_PP_reg_g=C_annual_PP_reg*($C_mg_mmol)/1000
let C_SCM_annual_PP_g=C_SCM_annual_PP*($C_mg_mmol)/1000
let C_SCM_annual_PP_new_g=C_SCM_annual_PP_new*($C_mg_mmol)/1000
let C_SCM_annual_PP_reg_g=C_SCM_annual_PP_reg*($C_mg_mmol)/1000
!To g C m-2 y-1 to Tg C y-1
let area_C_PP=C_annual_PP_g*($area)/($tera)
let area_C_SCM_PP=C_SCM_annual_PP_g*($area)/($tera)
!list area_C_PP
!list area_C_SCM_PP
list/clobber/file=Annual_primary_production.dat annual_PP, SCM_annual_PP, contribution_of_SCM_at_annual_PP, annual_PP_new, SCM_annual_PP_new, contribution_of_SCM_at_annual_PP_new, annual_PP_reg, SCM_annual_PP_reg, contribution_of_SCM_at_annual_PP_reg, C_annual_PP_g, C_SCM_annual_PP_g, C_annual_PP_new_g, C_SCM_annual_PP_new_g, C_annual_PP_reg_g, C_SCM_annual_PP_reg_g,area_C_PP, area_C_SCM_PP
exit
! NOAA/PMEL TMAP
! FERRET v6.62
! Linux(gfortran) 2.6.9-89.0.20.ELsmp - 06/11/10
! 7-Feb-11 11:11
use amdgulf
!Variables definition.
define symbol D=15-may-2008
define symbol alpha=0.11
define symbol inib=0.001
define symbol vp=0.3
define symbol p0=0.0001
define symbol k1=0.2
define symbol k2=0.8
define symbol C_mg_mmol=12.001
define symbol N_mg_mmol=14.007
define symbol C_N=(8.82/(($C_mg_mmol)/($N_mg_mmol)))
define symbol N_mmol_Chla=(15.54/($N_mg_mmol))
define symbol area=450000*1000^2
define symbol tera=10^12
!Find the maximum concentration of phy (if excluding the accumulation in the bottom layer; k=6:80)
let max_phy=phy[k=1:80@max]
!plot max_phy
!frame/file=phy_concentration_SCM.gif
!Phy concentration normalized (between 0 and 1). To assess the presence of a SCM, it could be usefull to normalized phy in order to remove the effect of changes in the concentration troughout the season.
let norm_phy=phy/max_phy
!fill norm_phy[k=6:80]
!frame/file=norm_phy.gif
!Determination of the depth of the SCM.
let depth_SCM=norm_phy[k=1:80@loc:1]
!plot depth_SCM
!frame/file=depth_SCM.gif
!Determination of the nitracline.
let d_nit=nit[k=1:80@ddc]
let nitracline=d_nit[k=40:80@loc:-0.02]
fill nit
frame/file=Nitrate.gif
!The centered derivative of phy (excluding the accumulation in the bottom layer; k=6:80@ddc).
let d_phy=phy[k=6:80@ddc]
!The centered derivative of normalized phy (excluding the accumulation in the bottom layer; k=6:80@ddc).
let d_norm_phy=norm_phy[k=6:80@ddc]
!Absolute values of d_phy and d_norm_phy. To avoid "s" profiles.
let abs_d_phy=abs(d_phy)
let abs_d_norm_phy=abs(d_norm_phy)
!plot /T=($D) abs_d_norm_phy
!frame/file=Derivative_of_normalized_phy_absolute.gif
!Smooth of of abs_d_phy to include norm_phy EQ 1.
let smooth_abs_d_phy=abs_d_phy[k=6:80@sbx:8]
!Graph of phytoplankton, SCM and nitracline depths and definition of the SCM zone.
!Phytoplankton mmol N m-3
fill /key=continous /pal=no_red phy[k=40:80]
contour/overplot norm_phy EQ 1
!contour/overplot d_nit[k=40:80] EQ -0.02
contour/overplot phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.002
frame/file=phytoplankton_mmol_N_m-3.gif
!Phytoplankton ug chla l-1.
let Chla_phy=phy/($N_mmol_Chla)
fill /key=continous /pal=no_red Chla_phy[k=40:80]
contour/overplot norm_phy EQ 1
contour/overplot phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.002
frame/file=phytoplankton_chla_ug_l.gif
plot /t=($D) phy
plot/overlay /t=($D) phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.01
frame/file=phy_daily.gif
!Define the primary production.
!Define Ps.
define symbol ps=($vp)/((($alpha)/(($alpha)+($inib)))*(($inib)/(($alpha)+($inib))))^(($inib)/($alpha))
!Define the photosynthesis equation.(Platt 1980)
let p=($ps)*(1-exp(-1*($alpha)*par/($ps)))*exp(-1*($inib)*par/($ps))
!Define the primary production, total, new, regenerated and f-ratio.
let new_prod=p*(phy+($p0))*(nit/(($k1)*(1+(nit/($k1))+(amm/($k2)))))
let reg_prod=p*(phy+($p0))*(amm/(($k2)*(1+(nit/($k1))+(amm/($k2)))))
let tot_prod = new_prod + reg_prod
let f_ratio = new_prod/tot_prod
!Graphs for the primary production.
!fill new_prod
!frame/file=new_prod.gif
!fill reg_prod
!frame/file=reg_prod.gif
!fill tot_prod
!frame/file=tot_prod.gif
!fill f_ratio
!frame/file=f_ratio.gif
!fill par
!frame/file=par.gif
!Definition of the primary production at the SCM.
let good_locations=phy[k=6:80] GE 0.1 and smooth_abs_d_phy[k=6:80] GE 0.002
fill /level=(0,1,0.5) /pal=grayscale good_locations[k=40:80]
!contour/overplot norm_phy EQ 1
frame/file=Good_locations.gif
let SCM_prod=tot_prod*good_locations
let SCM_new_prod=new_prod*good_locations
let SCM_reg_prod=reg_prod*good_locations
!fill SCM_prod
!frame/file=PP_at_the_SCM.gif
let i_prod=tot_prod[k=6:80@sum]
let i_new_prod=new_prod[k=6:80@sum]
let i_reg_prod=reg_prod[k=6:80@sum]
let i_SCM_prod=SCM_prod[k=6:80@sum]
let i_SCM_new_prod=SCM_new_prod[k=6:80@sum]
let i_SCM_reg_prod=SCM_reg_prod[k=6:80@sum]
!Ratio PP at the SCM over total PP in the water column.
let PP_ratio=i_SCM_prod/i_prod
let PP_new_ratio=i_SCM_new_prod/i_new_prod
let PP_reg_ratio=i_SCM_reg_prod/i_reg_prod
!Integrated primary production and contribution of the SCM with hourly mean radiative fluxes.
plot i_prod[l=1:2920@sbx:8]
plot/overlay i_SCM_prod[l=1:2920@sbx:8]
plot/overlay PP_ratio[l=1:2920@sbx:8]
frame/file=Integrated_PP.gif
plot i_new_prod[l=1:2920@sbx:8]
plot/overlay i_SCM_new_prod[l=1:2920@sbx:8]
plot/overlay PP_new_ratio[l=1:2920@sbx:8]
frame/file=Integrated_PP_new.gif
plot i_reg_prod[l=1:2920@sbx:8]
plot/overlay i_SCM_reg_prod[l=1:2920@sbx:8]
plot/overlay PP_reg_ratio[l=1:2920@sbx:8]