Skip to content

Commit

Permalink
fix(recom): Bugfixes for the branch fesom2_3zoo_ballast
Browse files Browse the repository at this point in the history
Correct variable sinking into benthos and coccos related tracer
indices for complex and basic case of recom
  • Loading branch information
ogurses committed Oct 1, 2024
1 parent daa02d4 commit ce6cbb3
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 19 deletions.
15 changes: 11 additions & 4 deletions src/int_recom/recom_modules.F90
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,16 @@ module recom_config

#if defined (__3Zoo2Det)
Integer :: izoo2n = 23, izoo2c =24, idetz2n = 25, &
idetz2c = 26, idetz2si = 27, idetz2calc = 28
idetz2c = 26, idetz2si = 27, idetz2calc = 28
integer, dimension(4) :: recom_det2_tracer_id = (/1025, 1026, 1027, 1028/)
#endif

#if defined (__coccos) & defined (__3Zoo2Det)
Integer :: icocn = 29, icocc = 30, icchl = 31
integer, dimension(3) :: recom_cocco_tracer_id = (/1029, 1030, 1031/)
#elif defined (__coccos) & !defined (__3Zoo2Det)
Integer :: icocn = 23, icocc = 24, icchl = 25
Integer :: icocn = 23, icocc = 24, icchl = 25
integer, dimension(3) :: recom_cocco_tracer_id = (/1023, 1024, 1025/)
#endif

#if defined (__coccos) & defined (__3Zoo2Det)
Expand All @@ -49,16 +52,20 @@ module recom_config

!!MB TEST: tracer ids for revised remineralization and sinking in oce_ale_tracer.F90
integer, dimension(8) :: recom_remin_tracer_id = (/1001, 1002, 1003, 1018, 1019, 1022, 1302, 1402/)



integer, dimension(29) :: recom_sinking_tracer_id = (/1007, 1008, 1017, 1021, 1004, 1005, 1020, 1006, &
1013, 1014, 1016, 1015, 1025, 1026, 1027, 1028, &
1029, 1030, 1031, & ! OG Cocco
1308, 1321, 1305, 1320, &
1314, 1408, 1421, 1405, 1420, 1414/)

integer, dimension(8) :: recom_det_tracer_id = (/1007, 1008, 1017, 1021, 1308, 1321, 1408, 1421/)
integer, dimension(8) :: recom_phy_tracer_id = (/1004, 1005, 1020, 1305, 1320, 1405, 1420, 1006/)
integer, dimension(6) :: recom_dia_tracer_id = (/1013, 1014, 1314, 1414, 1016, 1015/)
integer, dimension(3) :: recom_cocco_tracer_id = (/1029, 1030, 1031/)
integer, dimension(4) :: recom_det2_tracer_id = (/1025, 1026, 1027, 1028/)
! integer, dimension(3) :: recom_cocco_tracer_id = (/1029, 1030, 1031/)
! integer, dimension(4) :: recom_det2_tracer_id = (/1025, 1026, 1027, 1028/)

Real(kind=8) :: zero = 0.d0
Integer :: one = 1
Expand Down
6 changes: 3 additions & 3 deletions src/int_recom/recom_sms.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth &
+ aggregationRate * CoccoN &
#endif
- grazingFlux_Det * grazEff & ! Sloppy feeding is thought because of grazing flux multiplied with grazeff
- grazingFlux_Det2 * grazEff2 &
! - grazingFlux_Det2 * grazEff2 & ! Removed : case without second zoo .OG. 01.10.2024
+ aggregationRate * PhyN &
+ aggregationRate * DiaN &
+ hetLossFlux &
Expand Down Expand Up @@ -1366,7 +1366,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth &
+ aggregationRate * CoccoC &
#endif
- grazingFlux_Det * recipDet * grazEff &
- grazingFlux_Det2 * recipDet2 * grazEff2 &
- grazingFlux_Det2 * recipDet * grazEff2 & ! corrected recipDet2 -> recipDet .OG. 01.10.2024
+ aggregationRate * PhyC &
+ aggregationRate * DiaC &
+ miczooLossFlux * recipQZoo3 &
Expand All @@ -1384,7 +1384,7 @@ subroutine REcoM_sms(n,Nn,state,thick,recipthick,SurfSR,sms,Temp, Sali_depth &
+ aggregationRate * CoccoC &
#endif
- grazingFlux_Det * recipDet * grazEff &
- grazingFlux_Det2 * recipDet2 * grazEff &
! - grazingFlux_Det2 * recipDet2 * grazEff & ! Removed : case without second zoo .OG. 01.10.2024
+ aggregationRate * phyC &
+ aggregationRate * DiaC &
+ hetLossFlux * recipQZoo &
Expand Down
40 changes: 29 additions & 11 deletions src/oce_ale_tracer.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1116,23 +1116,31 @@ subroutine ver_sinking_recom_benthos(tr_num,mesh)

! 1) Calculate sinking velociy for vertical sinking case
! ******************************************************
if (allow_var_sinking) then
if (any(recom_det_tracer_id == tracer_id(tr_num))) Vben = Vdet
if (any(recom_phy_tracer_id == tracer_id(tr_num))) Vben = VPhy
if (any(recom_dia_tracer_id == tracer_id(tr_num))) Vben = VDia

if (any(recom_det_tracer_id == tracer_id(tr_num))) Vben = Vdet
if (any(recom_phy_tracer_id == tracer_id(tr_num))) Vben = VPhy
if (any(recom_dia_tracer_id == tracer_id(tr_num))) Vben = VDia
if (any(recom_cocco_tracer_id == tracer_id(tr_num))) Vben = VCocco ! check conditions (#if defined (__coccos)) and add the necessary tracers numbers below OG:
! Adjust iphycalc

#if defined (__coccos)
if(tracer_id(tr_num)==1020) Vben = VCocco !iphycal in case of coccos
#endif

if (allow_var_sinking .and. any(recom_det_tracer_id == tracer_id(tr_num))) then
Vben = Vdet_a * abs(zbar_3d_n(:,n)) + Vben
end if

! Constant vertical sinking for the second detritus class
! *******************************************************

#if defined(__3Zoo2Det)
if(tracer_id(tr_num)==1025 .or. & !idetz2n
tracer_id(tr_num)==1026 .or. & !idetz2c
tracer_id(tr_num)==1027 .or. & !idetz2si
tracer_id(tr_num)==1028 ) then !idetz2calc
Vben = VDet_zoo2
endif
if(tracer_id(tr_num)==1025 .or. & !idetz2n
tracer_id(tr_num)==1026 .or. & !idetz2c
tracer_id(tr_num)==1027 .or. & !idetz2si
tracer_id(tr_num)==1028 ) then !idetz2calc
Vben = VDet_zoo2
endif
#endif

Vben= Vben/SecondsPerDay ! conversion [m/d] --> [m/s] (vertical velocity, note that it is positive here)
Expand All @@ -1155,6 +1163,11 @@ subroutine ver_sinking_recom_benthos(tr_num,mesh)
! Particulate Organic Nitrogen
if( tracer_id(tr_num)==1004 .or. & !iphyn
tracer_id(tr_num)==1007 .or. & !idetn
#if defined (__coccos) & defined (__3Zoo2Det)
tracer_id(tr_num)==1029 .or. & !icocn
#elif defined (__coccos) & !defined (__3Zoo2Det)
tracer_id(tr_num)==1023 .or. & !icocn
#endif
tracer_id(tr_num)==1013 ) then !idian
! tracer_id(tr_num)==1013 .or. & !idian
! tracer_id(tr_num)==1025 ) then !idetz2n
Expand All @@ -1176,6 +1189,11 @@ subroutine ver_sinking_recom_benthos(tr_num,mesh)
! Particulate Organic Carbon
if( tracer_id(tr_num)==1005 .or. & !iphyc
tracer_id(tr_num)==1008 .or. & !idetc
#if defined (__coccos) & defined (__3Zoo2Det)
tracer_id(tr_num)==1030 .or. & !icocc
#elif defined (__coccos) & !defined (__3Zoo2Det)
tracer_id(tr_num)==1024 .or. & !icocc
#endif
tracer_id(tr_num)==1014 ) then
! tracer_id(tr_num)==1014 .or. & !idiac
! tracer_id(tr_num)==1026 ) then !idetz2c
Expand Down Expand Up @@ -1211,7 +1229,7 @@ subroutine ver_sinking_recom_benthos(tr_num,mesh)
endif

! Cal
if( tracer_id(tr_num)==1020 .or. & !iphycal
if( tracer_id(tr_num)==1020 .or. & !iphycal ! computed using Vcocco in case of coccos, otherwise Vphy
tracer_id(tr_num)==1021 ) then !idetcal
! tracer_id(tr_num)==1021 .or. & !idetcal
! tracer_id(tr_num)==1028 ) then !idetz2cal
Expand Down
2 changes: 1 addition & 1 deletion src/recom_sinking.F90
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ subroutine recom_sinking_new(tr_num,mesh)
#endif
end if

!! No sinking if background sinking velocity is less than 0.1 m/day
!! Very low or no sinking if background sinking velocity is less than 0.1 m/day
if (Vsink .gt. 0.1) then

do n = 1,myDim_nod2D
Expand Down

0 comments on commit ce6cbb3

Please sign in to comment.