Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer most parameters into mo_param_bgc #294

Merged
merged 11 commits into from
Nov 1, 2023
4 changes: 2 additions & 2 deletions cime_config/namelist_definition_blom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@
<values>
<value>.002</value>
</values>
<desc>Nondiemnsional coefficient of quadratic bottom friction (f)</desc>
<desc>Nondimensional coefficient of quadratic bottom friction (f)</desc>
</entry>

<entry id="cwbdts">
Expand All @@ -337,7 +337,7 @@
<value ocn_grid="tnx0.25v4" >0.75e-4</value>
<value ocn_grid="tnx0.125v4">.75e-4</value>
</values>
<desc>Coastal wave breaking damping resiprocal time scale (1/s) (f)</desc>
<desc>Coastal wave breaking damping reciprocal time scale (1/s) (f)</desc>
</entry>

<entry id="cwbdls">
Expand Down
3 changes: 2 additions & 1 deletion hamocc/accfields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ SUBROUTINE ACCFIELDS(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
use mo_biomod, only: bsiflx_bot,bsiflx0100,bsiflx0500,bsiflx1000,bsiflx2000,bsiflx4000,calflx_bot,calflx0100,calflx0500,&
calflx1000,calflx2000,calflx4000,carflx_bot,carflx0100,carflx0500,carflx1000,carflx2000,carflx4000,&
expoca,expoor,exposi,intdms_bac,intdms_uv,intdmsprod,intdnit,intnfix,intphosy,phosy3d, &
asize3d,eps3d,wnumb,wmass, int_chbr3_prod,int_chbr3_uv, c14fac,re1312,re14to
int_chbr3_prod,int_chbr3_uv,asize3d,eps3d,wnumb,wmass
use mo_param_bgc, only: c14fac,re1312,re14to
use mo_bgcmean, only: domassfluxes,jalkali,jano3,jasize,jatmco2,jbsiflx0100,jbsiflx0500,jbsiflx1000,jbsiflx2000, &
jbsiflx4000,jbsiflx_bot,jcalc,jcalflx0100,jcalflx0500,jcalflx1000,jcalflx2000,jcalflx4000, &
jcalflx_bot,jcarflx0100,jcarflx0500,jcarflx1000,jcarflx2000,jcarflx4000,jcarflx_bot, &
Expand Down
2 changes: 1 addition & 1 deletion hamocc/aufr_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ SUBROUTINE AUFR_BGC(kpie,kpje,kpke,ntr,ntrbgc,itrbgc,trc, &
use mo_vgrid, only: kbo
use mo_sedmnt, only: sedhpl
use mo_intfcblom, only: sedlay2,powtra2,burial2,atm2
use mo_biomod, only: bifr13,bifr14,c14fac,re1312,re14to,prei13,prei14
use mo_param_bgc, only: bifr13,bifr14,c14fac,re1312,re14to,prei13,prei14

implicit none

Expand Down
5 changes: 3 additions & 2 deletions hamocc/carchm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ SUBROUTINE CARCHM(kpie,kpje,kpke,kbnd, &
iatmnco2,inatalkali,inatcalc,inatsco212, &
ks,issso14,isssc14,ipowc14, &
iatmbromo,ibromo
use mo_param_bgc, only: c14dec,atm_co2_nat
use mo_vgrid, only: dp_min,kmle,kbo,ptiestu
use mo_carbch, only: atm_cfc11_nh,atm_cfc11_sh,atm_cfc12_nh,atm_cfc12_sh,atm_sf6_nh,atm_sf6_sh, &
co213fxd,co213fxu,co214fxd,co214fxu,c14dec, &
atm_co2_nat,nathi,natco3,natpco2d,natomegaa,natomegac
co213fxd,co213fxu,co214fxd,co214fxu, &
nathi,natco3,natpco2d,natomegaa,natomegac
use mo_sedmnt, only: sedlay,powtra,burial

implicit none
Expand Down
13 changes: 6 additions & 7 deletions hamocc/cyano.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ SUBROUTINE CYANO(kpie,kpje,kpke,kbnd,pddpo,omask,ptho)
! .
!**********************************************************************

use mo_carbch, only: ocetra
use mo_biomod, only: bluefix,intnfix,rnit,tf0,tf1,tf2,tff
use mo_param1_bgc, only: ialkali,iano3,igasnit,iphosph,ioxygen
use mo_vgrid, only: kmle
! natDIC
use mo_param1_bgc, only: inatalkali
use mo_control_bgc, only : use_natDIC
use mo_vgrid, only: kmle
use mo_carbch, only: ocetra
use mo_param_bgc, only: bluefix,rnit,tf0,tf1,tf2,tff
use mo_param1_bgc, only: ialkali,iano3,igasnit,iphosph,ioxygen,inatalkali
use mo_biomod, only: intnfix
use mo_control_bgc, only: use_natDIC

implicit none

Expand Down
5 changes: 3 additions & 2 deletions hamocc/hamocc_init.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
bgc_dx,bgc_dy,bgc_dp,bgc_rho, &
omask,sedlay2,powtra2,burial2, &
blom2hamocc,atm2
use mo_ini_fields, only: ini_fields_ocean,ini_fields_atm
implicit none

integer, intent(in) :: read_rest
Expand Down Expand Up @@ -179,8 +180,8 @@ subroutine hamocc_init(read_rest,rstfnm_hamocc)
! --- Initialize parameters, sediment and ocean tracer.
!
CALL ini_parambgc(idm,jdm)
CALL BELEG_VARS(read_rest,idm,jdm,kdm,nbdy,bgc_dp,bgc_rho,omask, &
& plon,plat)
call ini_fields_atm(idm,jdm) ! initialize atmospheric fields with (updated) parameter values
CALL ini_fields_ocean(read_rest,idm,jdm,kdm,nbdy,bgc_dp,bgc_rho,omask,plon,plat)
!
! --- Initialise reading of input data (dust, n-deposition, river, etc.)
!
Expand Down
3 changes: 2 additions & 1 deletion hamocc/inventory_bgc.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ SUBROUTINE INVENTORY_BGC(kpie,kpje,kpke,dlxp,dlyp,ddpo,omask,iogrp)
use mod_xc, only: mnproc,ips,nbdy,xcsum
use mo_carbch, only: atm,atmflx,co3,hi,ndepflx,rivinflx,ocetra,sedfluxo
use mo_sedmnt, only: prcaca,prorca,silpro
use mo_biomod, only: expoor,expoca,exposi,rcar,rnit
use mo_biomod, only: expoor,expoca,exposi
use mo_param_bgc, only: rcar,rnit
use mo_control_bgc, only: do_ndep,do_rivinpt,io_stdo_bgc
use mo_bgcmean, only: bgct2d,jco2flux,jirdin,jn2flux,jn2oflux,jndep,jo2flux,jprcaca,jprorca,jsilpro,nbgcmax,glb_inventory
use mo_param1_bgc, only: ialkali,ian2o,iano3,iatmco2,iatmn2,iatmn2o,iatmo2,icalc,idet,idoc,igasnit,iopal,ioxygen,iphosph, &
Expand Down
2 changes: 1 addition & 1 deletion hamocc/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ sources += files(
'accfields.F90',
'aufr_bgc.F90',
'aufw_bgc.F90',
'beleg_vars.F90',
'mo_ini_fields.F90',
'carchm.F90',
'carchm_kequi.F90',
'carchm_solve.F90',
Expand Down
2 changes: 1 addition & 1 deletion hamocc/mo_apply_fedep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ subroutine apply_fedep(kpie,kpje,kpke,pddpo,omask,dust)
!--------------------------------------------------------------------------------
use mo_control_bgc, only: dtb
use mo_param1_bgc, only: ifdust,iiron
use mo_biomod, only: perc_diron
use mo_param_bgc, only: perc_diron
use mo_carbch, only: ocetra

implicit none
Expand Down
3 changes: 1 addition & 2 deletions hamocc/mo_apply_ndep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ subroutine apply_ndep(kpie,kpje,kpke,pddpo,omask,ndep)
! *REAL* *ndep* - N-deposition field to apply
!
!******************************************************************************
use mod_xc, only: mnproc
use mo_control_bgc, only: io_stdo_bgc,dtb,do_ndep
use mo_control_bgc, only: dtb,do_ndep
use mo_carbch, only: ocetra,ndepflx
use mo_param1_bgc, only: iano3,ialkali,inatalkali
use mo_control_bgc, only: use_natDIC
Expand Down
48 changes: 16 additions & 32 deletions hamocc/mo_biomod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,24 @@ MODULE mo_biomod
implicit none

REAL, DIMENSION (:,:), ALLOCATABLE :: strahl
! FB_BGC_OCE
! FB_BGC_OCE
REAL, DIMENSION (:,:,:), ALLOCATABLE :: abs_oce
!
REAL, DIMENSION (:,:), ALLOCATABLE :: expoor
REAL, DIMENSION (:,:), ALLOCATABLE :: expoca
REAL, DIMENSION (:,:), ALLOCATABLE :: exposi
REAL, DIMENSION (:,:), ALLOCATABLE :: intphosy
REAL, DIMENSION (:,:), ALLOCATABLE :: intdnit
REAL, DIMENSION (:,:), ALLOCATABLE :: intnfix
REAL, DIMENSION (:,:), ALLOCATABLE :: intdmsprod
REAL, DIMENSION (:,:), ALLOCATABLE :: intphosy
REAL, DIMENSION (:,:), ALLOCATABLE :: intdnit
REAL, DIMENSION (:,:), ALLOCATABLE :: intnfix
REAL, DIMENSION (:,:), ALLOCATABLE :: intdmsprod
REAL, DIMENSION (:,:), ALLOCATABLE :: intdms_bac
REAL, DIMENSION (:,:), ALLOCATABLE :: intdms_uv
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx0100
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx0500
REAL, DIMENSION (:,:), ALLOCATABLE :: intdms_uv
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx0100
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx0500
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx1000
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx2000
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx4000
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx_bot
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx2000
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx4000
REAL, DIMENSION (:,:), ALLOCATABLE :: carflx_bot
REAL, DIMENSION (:,:), ALLOCATABLE :: bsiflx0100
REAL, DIMENSION (:,:), ALLOCATABLE :: bsiflx0500
REAL, DIMENSION (:,:), ALLOCATABLE :: bsiflx1000
Expand All @@ -93,28 +93,12 @@ MODULE mo_biomod
REAL, DIMENSION (:,:), ALLOCATABLE :: int_chbr3_prod
REAL, DIMENSION (:,:), ALLOCATABLE :: int_chbr3_uv

REAL :: phytomi,grami,grazra,pi_alpha
REAL :: remido,dyphy,zinges,epsher,spemor,gammap,gammaz,ecan
REAL :: ro2ut,rcar,rnit,rnoi,rdnit0,rdnit1,rdnit2,rdn2o1,rdn2o2,rcalc,ropal
REAL :: bluefix,tf2,tf1,tf0,tff
REAL :: bkphy,bkzoo,bkopal
REAL :: wpoc,wcal,wopal
REAL :: drempoc,dremopal,dremn2o,dremsul
REAL :: perc_diron, riron, fesoly, relaxfe, fetune, wdust
REAL :: ctochl, atten_w, atten_c, atten_uv, atten_f
! cisonew
REAL :: c14fac
REAL :: re1312,re14to,prei13,prei14
REAL :: bifr13,bifr14,growth_co2,bifr13_perm
REAL :: growth_co2,bifr13_perm
! AGG
REAL :: SinkExp, FractDim, Stick, cellmass, cellsink, fsh, fse
REAL :: alow1, alow2,alow3,alar1,alar2,alar3,TSFac,TMFac
REAL :: vsmall,safe,pupper,plower,zdis,nmldmin
REAL :: dustd1,dustd2,dustd3,dustsink,calmax
! WLIN
REAL :: wmin,wmax,wlin
! BROMO
REAL :: rbro
! REAL :: SinkExp, FractDim, Stick, cellmass, cellsink, fsh, fse
! REAL :: alow1, alow2,alow3,alar1,alar2,alar3,TSFac,TMFac
! REAL :: vsmall,safe,pupper,plower,zdis,nmldmin
! REAL :: dustd1,dustd2,dustd3,dustsink,calmax

CONTAINS

Expand Down
4 changes: 2 additions & 2 deletions hamocc/mo_boxatm.F90
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ subroutine update_boxatm(kpie,kpje,kpke,pdlxp,pdlyp,pddpo,omask)
!******************************************************************************
use mod_xc, only: mnproc,nbdy,ips,xcsum
use mo_control_bgc, only: io_stdo_bgc, use_cisonew, use_sedbypass
use mo_carbch, only: atmflx, atm, c14dec, ocetra
use mo_carbch, only: atmflx, atm, ocetra
use mo_param_bgc, only: rcar,c14dec
use mo_param1_bgc, only: iatmco2,iatmc13,iatmc14,isco214,idet14,icalc14,idoc14, &
iphy14,izoo14,ipowc14,issso14,isssc14
use mo_biomod, only: rcar
use mo_sedmnt, only: powtra,sedlay,seddw,porwat,porsol

implicit none
Expand Down
21 changes: 8 additions & 13 deletions hamocc/mo_carbch.F90
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,20 @@ MODULE mo_carbch
! Allocate memory for inorganic carbon variables
!
!
!**********************************************************************
!**********************************************************************
implicit none

REAL, DIMENSION (:,:,:,:), ALLOCATABLE :: ocetra
REAL, DIMENSION (:,:,:), ALLOCATABLE :: atm
REAL, DIMENSION (:,:,:), ALLOCATABLE :: atm
REAL, DIMENSION (:,:,:), ALLOCATABLE :: atmflx
REAL, DIMENSION (:,:), ALLOCATABLE :: ndepflx
REAL, DIMENSION (:,:), ALLOCATABLE :: oalkflx
REAL, DIMENSION (:,:,:), ALLOCATABLE :: rivinflx
REAL, DIMENSION (:,:,:), ALLOCATABLE :: rivinflx
REAL, DIMENSION (:,:,:), ALLOCATABLE :: co3
REAL, DIMENSION (:,:,:), ALLOCATABLE :: co2star
REAL, DIMENSION (:,:,:), ALLOCATABLE :: co2star
REAL, DIMENSION (:,:,:), ALLOCATABLE :: hi
REAL, DIMENSION (:,:,:), ALLOCATABLE :: OmegaA
REAL, DIMENSION (:,:,:), ALLOCATABLE :: OmegaC
REAL, DIMENSION (:,:,:), ALLOCATABLE :: OmegaA
REAL, DIMENSION (:,:,:), ALLOCATABLE :: OmegaC
REAL, DIMENSION (:,:,:), ALLOCATABLE :: keqb

REAL, DIMENSION (:,:,:), ALLOCATABLE :: satoxy
Expand All @@ -86,20 +86,15 @@ MODULE mo_carbch
REAL, DIMENSION (:,:), ALLOCATABLE :: co213fxu
REAL, DIMENSION (:,:), ALLOCATABLE :: co214fxd
REAL, DIMENSION (:,:), ALLOCATABLE :: co214fxu
REAL :: dmspar(6)
REAL :: atm_co2_nat
REAL, DIMENSION (:,:), ALLOCATABLE :: natpco2d
REAL, DIMENSION (:,:,:), ALLOCATABLE :: nathi
REAL, DIMENSION (:,:,:), ALLOCATABLE :: natco3
REAL, DIMENSION (:,:,:), ALLOCATABLE :: natOmegaA
REAL, DIMENSION (:,:,:), ALLOCATABLE :: natOmegaC
REAL :: atm_co2, atm_o2, atm_n2
REAL :: atm_c13, atm_c14
REAL :: c14_t_half, c14dec
REAL :: atm_co2
REAL :: atm_cfc11_nh,atm_cfc11_sh
REAL :: atm_cfc12_nh,atm_cfc12_sh
REAL :: atm_sf6_nh,atm_sf6_sh
REAL :: atm_bromo, fbro1, fbro2

CONTAINS

Expand Down
60 changes: 54 additions & 6 deletions hamocc/beleg_vars.F90 → hamocc/mo_ini_fields.F90
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,57 @@
!
! You should have received a copy of the GNU Lesser General Public License
! along with BLOM. If not, see https://www.gnu.org/licenses/.
module mo_ini_fields

SUBROUTINE BELEG_VARS(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask, &
pglon,pglat)
implicit none

private

public :: ini_fields_ocean,ini_fields_atm

contains

!---------------------------------------------------------------------------------------------------------------------------------
subroutine ini_fields_atm(kpie,kpje)
use mo_control_bgc, only: use_natDIC,use_cisonew,use_BROMO
use mo_param1_bgc, only: iatmco2,iatmo2,iatmn2,iatmnco2,iatmc13,iatmc14,iatmbromo
use mo_param_bgc, only: atm_o2,atm_n2,atm_co2_nat,atm_c13,atm_c14,c14fac,atm_bromo
use mo_carbch, only: atm,atm_co2

implicit none

!
! Initialise atmosphere fields. We use a 2D representation of atmospheric
! fields for simplicity, even for cases where actually only a scalar value
! is used. The overhead of this is small. If an atm-field is present in
! restart file (if BOXATM is activated), this will be overwritten later.
!

INTEGER, intent(in) :: kpie,kpje
INTEGER :: i,j

DO j=1,kpje
DO i=1,kpie
atm(i,j,iatmco2) = atm_co2
atm(i,j,iatmo2) = atm_o2
atm(i,j,iatmn2) = atm_n2
if (use_natDIC) then
atm(i,j,iatmnco2) = atm_co2_nat
end if
if (use_cisonew) then
atm(i,j,iatmc13) = atm_c13
atm(i,j,iatmc14) = atm_c14/c14fac
end if
if (use_BROMO) then
atm(i,j,iatmbromo)= atm_bromo
end if
ENDDO
ENDDO
end subroutine ini_fields_atm



SUBROUTINE ini_fields_ocean(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask,pglon,pglat)
!******************************************************************************
!
! BELEG_VARS - initialize bgc variables.
Expand Down Expand Up @@ -53,7 +101,8 @@ SUBROUTINE BELEG_VARS(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask, &
!******************************************************************************

use mo_carbch, only: co2star,co3,hi,ocetra
use mo_biomod, only: fesoly
use mo_param_bgc, only: fesoly,cellmass,fractdim,bifr13,bifr14,c14fac,re1312,re14to
use mo_biomod, only: abs_oce
use mo_control_bgc, only: rmasks,use_FB_BGC_OCE, use_cisonew, use_AGG, use_CFC, use_natDIC, use_BROMO, use_sedbypass
use mo_param1_bgc, only: ialkali,ian2o,iano3,icalc,idet,idicsat,idms,idoc,ifdust,igasnit,iiron,iopal,ioxygen,iphosph,iphy, &
iprefalk,iprefdic,iprefo2,iprefpo4,isco212,isilica,izoo, &
Expand All @@ -63,7 +112,6 @@ SUBROUTINE BELEG_VARS(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask, &
ipowaal,ipowaic,ipowaox,ipowaph,ipowasi,ipown2,ipowno3,isssc12,issso12,issssil,issster,ks,nsedtra, &
ipowc13,ipowc13,issso13,issso13,isssc13,ipowc14,isssc14,issso14
use mo_vgrid, only: kmle,kbo
use mo_biomod, only: cellmass,fractdim,bifr13,bifr14,c14fac,re1312,re14to,abs_oce
use mo_carbch, only: nathi,natco3
use mo_sedmnt, only: sedhpl,burial,powtra,sedlay

Expand Down Expand Up @@ -275,6 +323,6 @@ SUBROUTINE BELEG_VARS(kpaufr,kpie,kpje,kpke,kbnd,pddpo,prho,omask, &

return
!******************************************************************************
end subroutine beleg_vars

end subroutine ini_fields_ocean

end module mo_ini_fields
Loading
Loading