Commit a62e5d30d0261594c916eb29c3664f92b8dfe5a2

Authored by dumoda01
1 parent 1025a7c4
Exists in master and in 1 other branch snow

Complement de la revision precedente

src/extras/bio/bio.F90
@@ -721,6 +721,11 @@ @@ -721,6 +721,11 @@
721 if (allocated(var_units)) deallocate(var_units) 721 if (allocated(var_units)) deallocate(var_units)
722 if (allocated(var_long)) deallocate(var_long) 722 if (allocated(var_long)) deallocate(var_long)
723 723
  724 +!DD
  725 + if (allocated(lumlim)) deallocate(lumlim)
  726 + if (allocated(nitlim)) deallocate(nitlim)
  727 + if (allocated(ammlim)) deallocate(ammlim)
  728 +
724 ! The external provide arrays 729 ! The external provide arrays
725 if (allocated(h)) deallocate(h) 730 if (allocated(h)) deallocate(h)
726 if (allocated(nuh)) deallocate(nuh) 731 if (allocated(nuh)) deallocate(nuh)
@@ -803,6 +808,17 @@ @@ -803,6 +808,17 @@
803 allocate(var_long(numc),stat=rc) 808 allocate(var_long(numc),stat=rc)
804 if (rc /= 0) stop 'init_bio(): Error allocating var_long)' 809 if (rc /= 0) stop 'init_bio(): Error allocating var_long)'
805 810
  811 +!DD
  812 +
  813 + allocate(lumlim(0:nlev),stat=rc)
  814 + if (rc /= 0) stop 'init_bio(): Error allocating (lumlim)'
  815 +
  816 + allocate(nitlim(0:nlev),stat=rc)
  817 + if (rc /= 0) stop 'init_bio(): Error allocating (nitlim)'
  818 +
  819 + allocate(ammlim(0:nlev),stat=rc)
  820 + if (rc /= 0) stop 'init_bio(): Error allocating (ammlim)'
  821 +
806 ! The external provide arrays 822 ! The external provide arrays
807 allocate(h(0:nlev),stat=rc) 823 allocate(h(0:nlev),stat=rc)
808 if (rc /= 0) stop 'init_bio(): Error allocating (h)' 824 if (rc /= 0) stop 'init_bio(): Error allocating (h)'
src/extras/bio/bio_save.F90
@@ -92,6 +92,15 @@ @@ -92,6 +92,15 @@
92 iret = new_nc_variable(ncid,'par',NF_REAL,4,dims,par_id) 92 iret = new_nc_variable(ncid,'par',NF_REAL,4,dims,par_id)
93 iret = set_attributes(ncid,par_id,units='W/m2',long_name='PAR') 93 iret = set_attributes(ncid,par_id,units='W/m2',long_name='PAR')
94 94
  95 + !DD Diagnostic des fonctions de croissance
  96 + iret = new_nc_variable(ncid,'lumlim',NF_REAL,4,dims,lumlim_id)
  97 + iret = set_attributes(ncid,lumlim_id,units='1/day', &
  98 + long_name='light limited growth rate')
  99 + iret = new_nc_variable(ncid,'nitlim',NF_REAL,4,dims,nitlim_id)
  100 + iret = set_attributes(ncid,nitlim_id,units='',long_name='nitrate limitation')
  101 + iret = new_nc_variable(ncid,'ammlim',NF_REAL,4,dims,ammlim_id)
  102 + iret = set_attributes(ncid,ammlim_id,units='',long_name='ammonium limitation')
  103 +
95 dims(1) = time_dim 104 dims(1) = time_dim
96 iret = new_nc_variable(ncid,'totn',NF_REAL,1,dims,totn_id) 105 iret = new_nc_variable(ncid,'totn',NF_REAL,1,dims,totn_id)
97 iret = set_attributes(ncid,totn_id,units='mmol/m**2', & 106 iret = set_attributes(ncid,totn_id,units='mmol/m**2', &
@@ -110,6 +119,11 @@ @@ -110,6 +119,11 @@
110 !CHG4 PAR (par = par(:)) 119 !CHG4 PAR (par = par(:))
111 iret = store_data(ncid,par_id,XYZT_SHAPE,nlev,array=par(:)) 120 iret = store_data(ncid,par_id,XYZT_SHAPE,nlev,array=par(:))
112 121
  122 + !DD
  123 + iret = store_data(ncid,lumlim_id,XYZT_SHAPE,nlev,array=lumlim(:))
  124 + iret = store_data(ncid,nitlim_id,XYZT_SHAPE,nlev,array=nitlim(:))
  125 + iret = store_data(ncid,ammlim_id,XYZT_SHAPE,nlev,array=ammlim(:))
  126 +
113 iret = store_data(ncid,totn_id,T_SHAPE,1,scalar=totn) 127 iret = store_data(ncid,totn_id,T_SHAPE,1,scalar=totn)
114 #endif 128 #endif
115 case default 129 case default
src/extras/bio/bio_var.F90
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 integer :: numc,numcc 21 integer :: numc,numcc
22 REALTYPE, dimension(:), allocatable :: zlev 22 REALTYPE, dimension(:), allocatable :: zlev
23 REALTYPE, dimension(:), allocatable :: par 23 REALTYPE, dimension(:), allocatable :: par
  24 + REALTYPE, dimension(:), allocatable :: lumlim,nitlim,ammlim !DD
24 REALTYPE, dimension(:,:), allocatable :: cc,ws 25 REALTYPE, dimension(:,:), allocatable :: cc,ws
25 integer :: surface_flux_method=-1 26 integer :: surface_flux_method=-1
26 integer :: n_surface_fluxes=-1 27 integer :: n_surface_fluxes=-1
@@ -35,6 +36,7 @@ @@ -35,6 +36,7 @@
35 integer, dimension(:), allocatable :: var_ids 36 integer, dimension(:), allocatable :: var_ids
36 integer :: wp_id !CHG2 37 integer :: wp_id !CHG2
37 integer :: par_id !CHG4 38 integer :: par_id !CHG4
  39 + integer :: lumlim_id,nitlim_id,ammlim_id !DD
38 character(len=64), dimension(:), allocatable :: var_names 40 character(len=64), dimension(:), allocatable :: var_names
39 character(len=64), dimension(:), allocatable :: var_units 41 character(len=64), dimension(:), allocatable :: var_units
40 character(len=64), dimension(:), allocatable :: var_long 42 character(len=64), dimension(:), allocatable :: var_long