Back to home page

MITgcm

 
 

    


File indexing completed on 2024-05-23 05:10:18 UTC

view on githubraw file Latest commit 82e538d8 on 2024-05-22 17:46:03 UTC
c0d1c06c15 Matt*0001 #include "BLING_OPTIONS.h"
                0002 
                0003 CBOP
                0004       subroutine BLING_INIT_VARIA( myThid )
                0005 
                0006 C     ==========================================================
                0007 C     | subroutine bling_init_varia
cab777d667 Matt*0008 C     | o Initialize variable parameters
c0d1c06c15 Matt*0009 C     ==========================================================
                0010 
e0f9a7ba0b Matt*0011       IMPLICIT NONE
                0012 
c0d1c06c15 Matt*0013 C     === Global variables ===
                0014 #include "SIZE.h"
                0015 #include "EEPARAMS.h"
                0016 #include "PARAMS.h"
                0017 #include "GRID.h"
54b6d6aa91 Matt*0018 #include "PTRACERS_SIZE.h"
                0019 #include "PTRACERS_PARAMS.h"
c0d1c06c15 Matt*0020 #include "BLING_VARS.h"
bd32e74360 Matt*0021 
c0d1c06c15 Matt*0022 C     !INPUT PARAMETERS:
                0023 C     myThid               :: thread number
                0024       INTEGER myThid
                0025 CEOP
                0026 
                0027 #ifdef ALLOW_BLING
                0028       INTEGER i,j, bi,bj
                0029       INTEGER k
                0030 c     CHARACTER*(MAX_LEN_MBUF) msgBuf
                0031 
                0032 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
                0033 
                0034 C--   Initialise global variables
                0035       DO bj = myByLo(myThid), myByHi(myThid)
                0036        DO bi = myBxLo(myThid), myBxHi(myThid)
e0f9a7ba0b Matt*0037         DO j=1-OLy,sNy+OLy
                0038          DO i=1-OLx,sNx+OLx
47de7c1e0e Matt*0039           DO k = 1, Nr
c0d1c06c15 Matt*0040             omegaC(i,j,k,bi,bj)     = 0. _d 0
                0041             omegaAr(i,j,k,bi,bj)    = 0. _d 0
                0042             irr_mem(i,j,k,bi,bj)    = 1. _d 0
                0043             chl(i,j,k,bi,bj)        = 0. _d 0
3b75ee2a42 Matt*0044             poc(i,j,k,bi,bj)        = 0. _d 0
4ac06494d5 Matt*0045             phyto_sm(i,j,k,bi,bj)   = 4. _d -7 / permil
                0046             phyto_lg(i,j,k,bi,bj)   = 4. _d -7 / permil
e0f9a7ba0b Matt*0047 #ifndef USE_BLING_V1
4ac06494d5 Matt*0048             phyto_diaz(i,j,k,bi,bj) = 4. _d -7 / permil
e0f9a7ba0b Matt*0049 #endif
c0d1c06c15 Matt*0050           ENDDO
82e538d851 aver*0051           chl_sat(i,j,bi,bj)        = 0. _d 0
e0f9a7ba0b Matt*0052           gamma_POM_2d(i,j,bi,bj)   = gamma_POM
                0053           wsink0_2d(i,j,bi,bj)      = wsink0
                0054           phi_DOM_2d(i,j,bi,bj)     = phi_DOM
                0055           phi_sm_2d(i,j,bi,bj)      = phi_sm
                0056           phi_lg_2d(i,j,bi,bj)      = phi_lg
                0057           Pc_0_2d(i,j,bi,bj)        = Pc_0
                0058           k_Fe_2d(i,j,bi,bj)        = k_Fe
                0059 #ifndef USE_BLING_V1
                0060           k_Fe_diaz_2d(i,j,bi,bj)   = k_Fe_diaz
                0061           Pc_0_diaz_2d(i,j,bi,bj)   = Pc_0_diaz
                0062           alpha_photo_2d(i,j,bi,bj) = alpha_photo
                0063 #endif
c0d1c06c15 Matt*0064          ENDDO
                0065         ENDDO
                0066        ENDDO
                0067       ENDDO
                0068 
47de7c1e0e Matt*0069 C Read in 2d bio related variables
                0070         IF ( bling_Pc_2dFile .NE. ' ' ) THEN
e0f9a7ba0b Matt*0071            CALL READ_FLD_XY_RL( bling_Pc_2dFile, ' ',
                0072      &                          Pc_0_2d, 0, myThid )
                0073         _EXCH_XY_RL(Pc_0_2d,myThid)
47de7c1e0e Matt*0074         ENDIF
                0075         IF ( bling_k_Fe2dFile .NE. ' ' ) THEN
e0f9a7ba0b Matt*0076            CALL READ_FLD_XY_RL( bling_k_Fe2dFile, ' ',
                0077      &                          k_Fe_2d, 0, myThid )
                0078         _EXCH_XY_RL(k_Fe_2d,myThid)
47de7c1e0e Matt*0079         ENDIF
af8f3b9ffc Matt*0080         IF ( bling_gamma_POM2dFile .NE. ' ' ) THEN
                0081            CALL READ_FLD_XY_RL( bling_gamma_POM2dFile, ' ',
e0f9a7ba0b Matt*0082      &                          gamma_POM_2d, 0, myThid )
                0083         _EXCH_XY_RL(gamma_POM_2d,myThid)
af8f3b9ffc Matt*0084         ENDIF
                0085         IF ( bling_wsink0_2dFile .NE. ' ' ) THEN
                0086            CALL READ_FLD_XY_RL( bling_wsink0_2dFile, ' ',
                0087      &                          wsink0_2d, 0, myThid )
                0088         _EXCH_XY_RL(wsink0_2d,myThid)
                0089         ENDIF
                0090         IF ( bling_phi_DOM2dFile .NE. ' ' ) THEN
                0091            CALL READ_FLD_XY_RL( bling_phi_DOM2dFile, ' ',
e0f9a7ba0b Matt*0092      &                          phi_DOM_2d, 0, myThid )
                0093         _EXCH_XY_RL(phi_DOM_2d,myThid)
af8f3b9ffc Matt*0094         ENDIF
                0095         IF ( bling_phi_sm2dFile .NE. ' ' ) THEN
                0096            CALL READ_FLD_XY_RL( bling_phi_sm2dFile, ' ',
e0f9a7ba0b Matt*0097      &                          phi_sm_2d, 0, myThid )
                0098         _EXCH_XY_RL(phi_sm_2d,myThid)
af8f3b9ffc Matt*0099         ENDIF
                0100         IF ( bling_phi_lg2dFile .NE. ' ' ) THEN
                0101            CALL READ_FLD_XY_RL( bling_phi_lg2dFile, ' ',
e0f9a7ba0b Matt*0102      &                          phi_lg_2d, 0, myThid )
                0103         _EXCH_XY_RL(phi_lg_2d,myThid)
                0104         ENDIF
                0105 #ifndef USE_BLING_V1
                0106         IF ( bling_Pc_2d_diazFile .NE. ' ' ) THEN
                0107            CALL READ_FLD_XY_RL( bling_Pc_2d_diazFile,' ',
                0108      &                          Pc_0_diaz_2d, 0, myThid)
                0109         _EXCH_XY_RL(Pc_0_diaz_2d,myThid)
                0110         ENDIF
                0111         IF (   bling_alpha_photo2dFile .NE. ' ' ) THEN
                0112            CALL READ_FLD_XY_RL( bling_alpha_photo2dFile, ' ',
                0113      &                          alpha_photo_2d, 0, myThid )
                0114         _EXCH_XY_RL(alpha_photo_2d,myThid)
                0115         ENDIF
                0116         IF ( bling_k_Fe_diaz2dFile .NE. ' ' ) THEN
                0117            CALL READ_FLD_XY_RL( bling_k_Fe_diaz2dFile, ' ',
                0118      &                          k_Fe_diaz_2d, 0, myThid )
                0119         _EXCH_XY_RL(k_Fe_diaz_2d,myThid)
af8f3b9ffc Matt*0120         ENDIF
e0f9a7ba0b Matt*0121 #endif
47de7c1e0e Matt*0122 
82e538d851 aver*0123 #ifdef ADVECT_PHYTO
                0124        DO bj = myByLo(myThid), myByHi(myThid)
                0125         DO bi = myBxLo(myThid), myBxHi(myThid)
                0126          DO k=1,Nr
                0127           DO j=1-OLy,sNy+OLy
                0128            DO i=1-OLx,sNx+OLx
                0129             phyto_sm(i,j,k,bi,bj)   = 0.5 _d 0
                0130             phyto_lg(i,j,k,bi,bj)   = 0.5 _d 0
                0131             phyto_diaz(i,j,k,bi,bj) = 0. _d 0
                0132            ENDDO
                0133           ENDDO
                0134          ENDDO
                0135         ENDDO
                0136        ENDDO
                0137 #else
                0138 C     Read phyto plankton abundance ICs and exchange
54b6d6aa91 Matt*0139       IF (nIter0.EQ.PTRACERS_Iter0) THEN
                0140         IF ( bling_psmFile .NE. ' ' ) THEN
                0141          CALL READ_FLD_XYZ_RL(bling_psmFile,' ',
                0142      &        phyto_sm(1-OLx,1-OLy,1,1,1),0,myThid)
                0143          _EXCH_XYZ_RL(phyto_sm(1-OLx,1-OLy,1,1,1),myThid)
                0144         ENDIF
                0145         IF (bling_plgFile .NE. ' ' ) THEN
                0146          CALL READ_FLD_XYZ_RL(bling_plgFile,' ',
                0147      &        phyto_lg(1-OLx,1-OLy,1,1,1),0,myThid)
                0148          _EXCH_XYZ_RL(phyto_lg(1-OLx,1-OLy,1,1,1),myThid)
                0149         ENDIF
e0f9a7ba0b Matt*0150 #ifndef USE_BLING_V1
54b6d6aa91 Matt*0151         IF ( bling_PdiazFile .NE. ' ' ) THEN
                0152          CALL READ_FLD_XYZ_RL(bling_pdiazFile,' ',
                0153      &        phyto_diaz(1-OLx,1-OLy,1,1,1),0,myThid)
                0154          _EXCH_XYZ_RL(phyto_diaz(1-OLx,1-OLy,1,1,1),myThid)
                0155         ENDIF
e0f9a7ba0b Matt*0156 #endif
54b6d6aa91 Matt*0157       ENDIF
82e538d851 aver*0158 #endif /* ifdef ADVECT_PHYTO */
54b6d6aa91 Matt*0159 C     Apply mask
                0160        DO bj = myByLo(myThid), myByHi(myThid)
                0161         DO bi = myBxLo(myThid), myBxHi(myThid)
                0162          DO k=1,Nr
                0163           DO j=1-OLy,sNy+OLy
                0164            DO i=1-OLx,sNx+OLx
                0165             IF (maskC(i,j,k,bi,bj).EQ.0.) THEN
                0166              phyto_sm(i,j,k,bi,bj)   = 0. _d 0
                0167              phyto_lg(i,j,k,bi,bj)   = 0. _d 0
e0f9a7ba0b Matt*0168 #ifndef USE_BLING_V1
54b6d6aa91 Matt*0169              phyto_diaz(i,j,k,bi,bj) = 0. _d 0
e0f9a7ba0b Matt*0170 #endif
54b6d6aa91 Matt*0171             ENDIF
                0172            ENDDO
                0173           ENDDO
                0174          ENDDO
                0175         ENDDO
                0176        ENDDO
                0177 
                0178 C      IF ( nIter0.GT.PTRACERS_Iter0 .OR.
                0179 C     &    (nIter0.EQ.PTRACERS_Iter0 .AND. pickupSuff.NE.' ')
                0180 C IF ABOVE TRUE phyto READ FROM PICKUP AND OVERWRITES IC READ
                0181 C PICKUP CALLED FROM bling_carbonate_init.F
                0182 C
                0183 
c0d1c06c15 Matt*0184 #endif /* ALLOW_BLING */
                0185 
                0186       RETURN
                0187       END