Back to home page

MITgcm

 
 

    


File indexing completed on 2024-08-30 05:10:51 UTC

view on githubraw file Latest commit ae2be615 on 2024-08-29 19:00:27 UTC
cdc6af4e53 Patr*0001 #include "DIC_OPTIONS.h"
51e381e9c9 Jean*0002 #undef USE_OLD_READ_PICKUP
cdc6af4e53 Patr*0003 
                0004 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0005 CBOP
                0006 C     !ROUTINE: DIC_INIT_VARIA
                0007 
                0008 C     !INTERFACE:
                0009       SUBROUTINE DIC_INIT_VARIA( myThid )
                0010 
                0011 C     !DESCRIPTION:
                0012 C     Initialize variable quantities
                0013 
                0014 C     !USES:
                0015       IMPLICIT NONE
                0016 #include "SIZE.h"
                0017 #include "EEPARAMS.h"
                0018 #include "PARAMS.h"
                0019 #include "GRID.h"
                0020 #include "DIC_VARS.h"
                0021 #include "DIC_ATMOS.h"
51e381e9c9 Jean*0022 #include "PTRACERS_SIZE.h"
                0023 #include "PTRACERS_PARAMS.h"
cdc6af4e53 Patr*0024 #ifdef ALLOW_COST
                0025 # include "DIC_COST.h"
                0026 #endif
                0027 C     !INPUT PARAMETERS:
51e381e9c9 Jean*0028 C     myThid               :: my Thread Id number
cdc6af4e53 Patr*0029       INTEGER myThid
                0030 CEOP
                0031 
                0032 #ifdef ALLOW_DIC
                0033       INTEGER i,j, bi,bj
2e3e8c330d Jona*0034 # ifdef DIC_CALCITE_SAT
cdc6af4e53 Patr*0035       INTEGER k
2e3e8c330d Jona*0036 # endif
c845fbfeae Jean*0037 c     CHARACTER*(MAX_LEN_MBUF) msgBuf
cdc6af4e53 Patr*0038 
                0039 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0040 
c8a76e9bb9 Jean*0041 C--   Initialise variable in common block DIC_ATMOS
51e381e9c9 Jean*0042 #ifndef ALLOW_AUTODIFF
c8a76e9bb9 Jean*0043       _BEGIN_MASTER(myThid)
51e381e9c9 Jean*0044 #endif
c8a76e9bb9 Jean*0045       total_atmos_carbon = 0. _d 0
                0046       total_ocean_carbon = 0. _d 0
                0047       total_atmos_carbon_year  = 0. _d 0
                0048       total_atmos_carbon_start = 0. _d 0
                0049       total_ocean_carbon_year  = 0. _d 0
                0050       total_ocean_carbon_start = 0. _d 0
                0051       atpco2 = 0. _d 0
                0052 #ifdef ALLOW_COST
                0053       totcost =  0. _d 0
                0054 #endif
ae2be6150b Jona*0055 C 2d surface pH
51e381e9c9 Jean*0056       pH_isLoaded(1) = .FALSE.
ae2be6150b Jona*0057 C 3d full ocean pH
51e381e9c9 Jean*0058       pH_isLoaded(2) = .FALSE.
                0059 #ifndef ALLOW_AUTODIFF
c8a76e9bb9 Jean*0060       _END_MASTER(myThid)
                0061       _BARRIER
51e381e9c9 Jean*0062 #endif
c8a76e9bb9 Jean*0063 
51e381e9c9 Jean*0064 C--   Initialise variables other than forcing (done in ini_forcing):
cdc6af4e53 Patr*0065       DO bj = myByLo(myThid), myByHi(myThid)
                0066        DO bi = myBxLo(myThid), myBxHi(myThid)
c8a76e9bb9 Jean*0067         DO j=1-OLy,sNy+OLy
51e381e9c9 Jean*0068          DO i=1-OLx,sNx+OLx
                0069            FluxCO2(i,j,bi,bj)  = 0. _d 0
                0070            pH(i,j,bi,bj)       = 8. _d 0
                0071          ENDDO
                0072         ENDDO
                0073 #ifdef DIC_BIOTIC
                0074 C-    Initialise alpha & rain_ratio fields with fixed (& Uniform) values
                0075         DO j=1-OLy,sNy+OLy
                0076          DO i=1-OLx,sNx+OLx
                0077            alpha(i,j,bi,bj)      = alphaUniform
                0078            rain_ratio(i,j,bi,bj) = rainRatioUniform
                0079          ENDDO
c845fbfeae Jean*0080         ENDDO
51e381e9c9 Jean*0081 #endif /* DIC_BIOTIC */
2e3e8c330d Jona*0082 #ifdef DIC_CALCITE_SAT
c845fbfeae Jean*0083         DO k = 1, Nr
c8a76e9bb9 Jean*0084          DO j=1-OLy,sNy+OLy
                0085           DO i=1-OLx,sNx+OLx
ae2be6150b Jona*0086            omegaC(i,j,k,bi,bj) = 0. _d 0
                0087            pH3D(i,j,k,bi,bj)   = 7.9 _d 0
cdc6af4e53 Patr*0088           ENDDO
                0089          ENDDO
c845fbfeae Jean*0090         ENDDO
2e3e8c330d Jona*0091 #endif /* DIC_CALCITE_SAT */
cdc6af4e53 Patr*0092        ENDDO
                0093       ENDDO
51e381e9c9 Jean*0094 
                0095 C--   Initialise forcing field variables (was called from gchem_init_vari.F)
                0096       CALL DIC_INI_FORCING(myThid)
                0097 
                0098 C-  read pickup
                0099       IF ( nIter0.GT.PTRACERS_Iter0 .OR.
                0100      &    (nIter0.EQ.PTRACERS_Iter0 .AND. pickupSuff.NE.' ')
                0101      &   ) THEN
                0102 C       Read pH from a pickup file if needed
                0103         CALL DIC_READ_PICKUP( nIter0, myThid )
                0104       ENDIF
                0105 
                0106 C-    Move these S/R call here (were previously in gchem_init_vari.F), except
                0107 C     DIC_INI_ATMOS which was called from the top of DIC_SURFFORCING_INIT
                0108       CALL DIC_INI_ATMOS( startTime, nIter0, myThid )
                0109       CALL DIC_SURFFORCING_INIT(myThid)
                0110       CALL DIC_BIOTIC_INIT(myThid)
                0111 # ifdef ALLOW_CTRL
                0112       CALL DIC_SET_CONTROL(myThid)
                0113 # endif
cdc6af4e53 Patr*0114 
                0115 #endif /* ALLOW_DIC */
                0116 
                0117       RETURN
                0118       END