Skip to content

Commit

Permalink
Synchronizing with gitlab 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgio Bolzon committed Nov 24, 2021
1 parent f46f4e1 commit 34ee72b
Show file tree
Hide file tree
Showing 60 changed files with 2,340 additions and 900 deletions.
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ KNDSTR = \
set_knd.o
OBJSTR = \
filename_mod.o\
da_params.o\
da_params.o\
drv_str.o\
cns_str.o\
obs_str.o\
Expand Down Expand Up @@ -100,11 +100,13 @@ PHYSOBS = \

OBJS = \
def_nml.o\
def_nml_multi.o\
def_grd.o\
sav_itr.o\
rdeofs_chl.o\
rdeofs_n3n.o\
rdeofs_o2o.o\
rdeofs_multi.o\
rdrcorr.o\
mean_rdr.o\
netcdf_err.o\
Expand All @@ -129,6 +131,7 @@ OBJS = \
obs_arg_ad.o\
veof_chl_ad.o\
veof_nut_ad.o\
veof_multiv_ad.o\
ver_hor_chl_ad.o\
ver_hor_nut_ad.o\
rcfl_x_ad.o\
Expand All @@ -146,8 +149,11 @@ OBJS = \
readChlStat.o\
readNutStat.o\
readNutCov.o\
readChlNutCov.o\
wrt_chl_stat.o\
wrt_upd_nut.o\
wrt_nut_stat.o\
cp_nut_stat.o\
costf.o\
obs_sat.o\
bio_conv.o\
Expand Down
10 changes: 8 additions & 2 deletions bio_conv.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,22 @@ subroutine bio_conv
!-----------------------------------------------------------------------

use grd_str
use eof_str
use bio_str
use drv_str

implicit none

INTEGER(i4) :: i, j, k, l
INTEGER(i4) :: i, j, k, l, my_km

grd%chl(:,:,:) = 0.0

my_km = grd%km
if(drv%multiv.eq.1) &
my_km = ros%kmchl

do l = 1,bio%nphy
do k = 1,grd%km
do k = 1,my_km
do j = 1,grd%jm
do i = 1,grd%im
grd%chl(i,j,k) = grd%chl(i,j,k) + bio%phy(i,j,k,l,1)
Expand Down
10 changes: 8 additions & 2 deletions bio_conv_ad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,22 @@ subroutine bio_conv_ad
!-----------------------------------------------------------------------

use grd_str
use eof_str
use bio_str
use drv_str

implicit none

INTEGER(i4) :: i, j, k, l
INTEGER(i4) :: i, j, k, l, my_km

bio%phy_ad(:,:,:,:,:) = 0.0

my_km = grd%km
if(drv%multiv .eq. 1) &
my_km = ros%kmchl

do l = 1,bio%nphy
do k = 1,grd%km
do k = 1,my_km
do j = 1,grd%jm
do i = 1,grd%im
bio%phy_ad(i,j,k,l,1) = bio%phy_ad(i,j,k,l,1) + grd%chl_ad(i,j,k)
Expand Down
9 changes: 7 additions & 2 deletions bio_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ subroutine bio_mod
use grd_str
use bio_str
use eof_str
use drv_str

IMPLICIT NONE

INTEGER(i4) :: m, l, k,j ,i
INTEGER(i4) :: m, l, k,j ,i, my_km

bio%phy(:,:,:,:,:) = 0.0

my_km = grd%km
if(drv%multiv .eq. 1) &
my_km = ros%kmchl

do m=1,bio%ncmp
do l=1,bio%nphy
do k=1,grd%km
do k=1,my_km
do j=1,grd%jm
do i=1,grd%im
bio%phy(i,j,k,l,m)=bio%cquot(i,j,k,l,m)*bio%pquot(i,j,k,l)*grd%chl(i,j,k)
Expand Down
9 changes: 7 additions & 2 deletions bio_mod_ad.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,21 @@ subroutine bio_mod_ad
use grd_str
use bio_str
use eof_str
use drv_str

IMPLICIT NONE

INTEGER(i4) :: m, l, k, j, i
INTEGER(i4) :: m, l, k, j, i, my_km

grd%chl_ad(:,:,:) = 0.0

my_km = grd%km
if(drv%multiv .eq. 1) &
my_km = ros%kmchl

do m=1,bio%ncmp
do l=1,bio%nphy
do k=1,grd%km
do k=1,my_km
do j=1,grd%jm
do i=1,grd%im
grd%chl_ad(i,j,k) = grd%chl_ad(i,j,k) + bio%cquot(i,j,k,l,m) * bio%pquot(i,j,k,l) * bio%phy_ad(i,j,k,l,m)
Expand Down
4 changes: 3 additions & 1 deletion bio_str.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ MODULE bio_str
REAL(r8), POINTER :: phy_ad(:,:,:,:,:) ! biogeochemical adjoint variables
REAL(r8), POINTER :: InitialChl(:,:,:) ! initial amount of chlorophyll
REAL(r8), POINTER :: InitialNut(:,:,:,:) ! initial amount of nutrients
REAL(r8), POINTER :: covn3n_n1p(:,:,:) ! initial amount of nutrients
REAL(r8), POINTER :: covn3n_n1p(:,:,:) ! covariance n3n n1p
REAL(r8), POINTER :: covn3n_chl(:,:,:) ! covariance n3n chl
REAL(r8), POINTER :: covn1p_chl(:,:,:) ! covariance n3n chl

INTEGER :: nphy ! number of phytoplankton types
INTEGER :: ncmp ! No. of phytoplankton components
Expand Down
5 changes: 5 additions & 0 deletions clean_mem.f90
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,16 @@ subroutine clean_mem
DEALLOCATE ( rcf%sc)

DEALLOCATE(SendCountX3D, SendDisplX3D)
DEALLOCATE(SendCountX3D_chl, SendDisplX3D_chl)
DEALLOCATE(RecCountX3D, RecDisplX3D)
DEALLOCATE(RecCountX3D_chl, RecDisplX3D_chl)

DEALLOCATE(ChlExtended)
DEALLOCATE(ChlExtended_3d,N3nExtended_3d,O2oExtended_3d)
DEALLOCATE(SendBottom, RecTop)
DEALLOCATE(SendTop, RecBottom)
DEALLOCATE(SendTop_2d, RecBottom_2d)
DEALLOCATE(SendBottom_2d, RecTop_2d)

if(MyId .eq. 0) then
write(*,*) ' ALL MEMORY CLEAN'
Expand Down
25 changes: 16 additions & 9 deletions cnv_inn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,28 @@ subroutine cnv_inn
! Convert the control vector to v
call cnv_ctv

if(drv%chl_assim .eq. 1) then
call ver_hor_chl
endif
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut(grd%n3n, grd%n3n_ad,'N')
if (drv%multiv .eq. 0) then
if(drv%chl_assim .eq. 1) then
call ver_hor_chl
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut(grd%o2o, grd%o2o_ad,'O')
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut(grd%n3n, grd%n3n_ad,'N')
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut(grd%o2o, grd%o2o_ad,'O')
endif
endif
endif

if (drv%multiv .eq. 1) then
call ver_hor_chl
call ver_hor_nut(grd%n3n, grd%n3n_ad,'N')
endif

! ---
! Apply biological repartition of the chlorophyll
if(drv%chl_assim .eq. 1) &
if((drv%chl_assim .eq. 1) .or. (drv%multiv .eq. 1)) &
call bio_mod

end subroutine cnv_inn
54 changes: 33 additions & 21 deletions costf.f90
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,28 @@ subroutine costf
call cnv_ctv

! --------
! Control to physical space
if(drv%chl_assim .eq. 1) then
call ver_hor_chl
endif
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut(grd%n3n, grd%n3n_ad, 'N')
! Control to physical space
if (drv%multiv.eq.0) then
if(drv%chl_assim .eq. 1) then
call ver_hor_chl
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut(grd%o2o, grd%o2o_ad, 'O')
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut(grd%n3n, grd%n3n_ad, 'N')
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut(grd%o2o, grd%o2o_ad, 'O')
endif
endif

else if(drv%multiv .eq. 1) then
call ver_hor_chl
call ver_hor_nut(grd%n3n, grd%n3n_ad, 'N')
endif

! ---
! Apply biological repartition of the chlorophyll
if(drv%chl_assim .eq. 1) &
if((drv%chl_assim .eq. 1) .or. (drv%multiv .eq. 1)) &
call bio_mod

! --------
Expand Down Expand Up @@ -109,23 +115,29 @@ subroutine costf

! ---
! Apply biological repartition of the chlorophyll
if(drv%chl_assim .eq. 1) &
if((drv%chl_assim .eq. 1) .or. (drv%multiv .eq. 1)) &
call bio_mod_ad

! --------
! Control to physical space
if(drv%chl_assim .eq. 1) then
call ver_hor_chl_ad
endif
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut_ad(grd%n3n, grd%n3n_ad, 'N')
! Control to physical space
if (drv%multiv .eq. 0) then
if(drv%chl_assim .eq. 1) then
call ver_hor_chl_ad
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut_ad(grd%o2o, grd%o2o_ad, 'O')
if(drv%nut .eq. 1) then
if(bio%N3n .eq. 1) then
call ver_hor_nut_ad(grd%n3n, grd%n3n_ad, 'N')
endif
if(bio%O2o .eq. 1) then
call ver_hor_nut_ad(grd%o2o, grd%o2o_ad, 'O')
endif
endif

else if(drv%multiv .eq. 1) then
call ver_hor_chl_ad
call ver_hor_nut_ad(grd%n3n, grd%n3n_ad, 'N')
call veof_multiv_ad
endif

! write(*,*) 'COSTF sum(ro_ad) = ' , sum(grd%ro_ad)
! --------
! Convert the control vector
Expand Down
Loading

0 comments on commit 34ee72b

Please sign in to comment.