Back to home page

MITgcm

 
 

    


File indexing completed on 2025-07-08 05:10:40 UTC

view on githubraw file Latest commit 00c7090d on 2025-07-07 16:10:22 UTC
4c563c2ee9 Chri*0001 CBOP
3b540d7094 Jean*0002 C     !ROUTINE: FFIELDS.h
4c563c2ee9 Chri*0003 C     !INTERFACE:
                0004 C     include "FFIELDS.h"
                0005 C     !DESCRIPTION:
                0006 C     \bv
                0007 C     *==========================================================*
3b540d7094 Jean*0008 C     | FFIELDS.h
                0009 C     | o Model forcing fields
4c563c2ee9 Chri*0010 C     *==========================================================*
6060ec2938 Dimi*0011 C     | More flexible surface forcing configurations are
14c6f9452b Jean*0012 C     | available via, e.g., pkg/exf
4c563c2ee9 Chri*0013 C     *==========================================================*
                0014 C     \ev
                0015 CEOP
924557e60a Chri*0016 C
6060ec2938 Dimi*0017 C     fu    :: Zonal surface wind stress in N/m^2
                0018 C              > 0 for increase in uVel, which is west to
                0019 C                  east for cartesian and spherical polar grids
                0020 C              Typical range: -0.5 < fu < 0.5
                0021 C              Southwest C-grid U point
4c84b0c69e Patr*0022 C
6060ec2938 Dimi*0023 C     fv    :: Meridional surface wind stress in N/m^2
                0024 C              > 0 for increase in vVel, which is south to
                0025 C                  north for cartesian and spherical polar grids
                0026 C              Typical range: -0.5 < fv < 0.5
                0027 C              Southwest C-grid V point
4c84b0c69e Patr*0028 C
6c510a0118 Jean*0029 C     EmPmR :: Net upward freshwater flux in kg/m2/s
6060ec2938 Dimi*0030 C              EmPmR = Evaporation - precipitation - runoff
                0031 C              > 0 for increase in salt (ocean salinity)
6c510a0118 Jean*0032 C              Typical range: -1e-4 < EmPmR < 1e-4
6060ec2938 Dimi*0033 C              Southwest C-grid tracer point
8f02cfbf56 Dimi*0034 C           NOTE: for backward compatibility EmPmRfile is specified in
                0035 C                 m/s when using external_fields_load.F.  It is converted
                0036 C                 to kg/m2/s by multiplying by rhoConstFresh.
4c84b0c69e Patr*0037 C
ba0b047096 Mart*0038 C  saltFlux :: Net upward salt flux in g/kg.kg/m^2/s = g/m^2/s
cbf60149f1 Jean*0039 C              flux of Salt taken out of the ocean per time unit (second).
ba0b047096 Mart*0040 C              Note: only used when salty sea-ice forms or melts.
3e01d879d6 Jean*0041 C              > 0 for decrease in SSS.
                0042 C              Southwest C-grid tracer point
                0043 C
2d2cc93d4f Jean*0044 C     Qnet  :: Net upward surface heat flux (including shortwave) in W/m^2
                0045 C              Qnet = latent + sensible + net longwave + net shortwave
6060ec2938 Dimi*0046 C              > 0 for decrease in theta (ocean cooling)
                0047 C              Typical range: -250 < Qnet < 600
                0048 C              Southwest C-grid tracer point
4c84b0c69e Patr*0049 C
6060ec2938 Dimi*0050 C     Qsw   :: Net upward shortwave radiation in W/m^2
                0051 C              Qsw = - ( downward - ice and snow absorption - reflected )
                0052 C              > 0 for decrease in theta (ocean cooling)
                0053 C              Typical range: -350 < Qsw < 0
                0054 C              Southwest C-grid tracer point
4c84b0c69e Patr*0055 C
6060ec2938 Dimi*0056 C     SST   :: Sea surface temperature in degrees C for relaxation
                0057 C              Southwest C-grid tracer point
                0058 C
ba0b047096 Mart*0059 C     SSS   :: Sea surface salinity in g/kg for relaxation
6060ec2938 Dimi*0060 C              Southwest C-grid tracer point
                0061 C
7e00d7e8f9 Jean*0062 C     lambdaThetaClimRelax :: Inverse time scale for SST relaxation ( 1/s ).
0ca98629d3 Patr*0063 C
7e00d7e8f9 Jean*0064 C     lambdaSaltClimRelax  :: Inverse time scale for SSS relaxation ( 1/s ).
0ca98629d3 Patr*0065 
8e1649be57 Jean*0066 C     phiTide2d :: vertically uniform (2d-map), time-dependent geopotential
                0067 C                  anomaly (e.g., tidal forcing); Units are m^2/s^2
6285e7ac4f Jean*0068 C     pLoad :: for the ocean:      atmospheric pressure anomaly (relative to
                0069 C                                   "surf_pRef") at z=eta
395b093796 Mart*0070 C                Units are           Pa=N/m^2
6285e7ac4f Jean*0071 C              for the atmosphere (hack): geopotential anomaly of the orography
                0072 C                Units are           m^2/s^2
9cd260ffd3 Jean*0073 C     sIceLoad :: sea-ice loading, expressed in Mass of ice+snow / area unit
b52bf74a5e Jean*0074 C                Units are           kg/m^2
                0075 C              Note: only used with Sea-Ice & RealFreshWater formulation
9cd260ffd3 Jean*0076 C     addMass  :: source (<0: sink) of fluid in the domain interior
                0077 C                 (generalisation of oceanic real fresh-water flux)
                0078 C                Units are           kg/s  (mass per unit of time)
                0079 C     frictionHeating :: heating caused by friction and momentum dissipation
434645f3d4 Jean*0080 C                Units are           in W/m^2 (thickness integrated)
43af9695da Gael*0081 C     eddyPsiX -Zonal Eddy Streamfunction in m^2/s used in taueddy_external_forcing.F
                0082 C     eddyPsiY -Meridional Streamfunction in m^2/s used in taueddy_external_forcing.F
ac957095b5 Patr*0083 C     EfluxY - y-component of Eliassen-Palm flux vector
                0084 C     EfluxP - p-component of Eliassen-Palm flux vector
4c84b0c69e Patr*0085 
96243313d2 Patr*0086       COMMON /FFIELDS_fu/ fu
                0087       COMMON /FFIELDS_fv/ fv
                0088       COMMON /FFIELDS_Qnet/ Qnet
                0089       COMMON /FFIELDS_Qsw/ Qsw
                0090       COMMON /FFIELDS_EmPmR/ EmPmR
                0091       COMMON /FFIELDS_saltFlux/ saltFlux
                0092       COMMON /FFIELDS_SST/ SST
                0093       COMMON /FFIELDS_SSS/ SSS
                0094       COMMON /FFIELDS_lambdaThetaClimRelax/ lambdaThetaClimRelax
                0095       COMMON /FFIELDS_lambdaSaltClimRelax/ lambdaSaltClimRelax
8e1649be57 Jean*0096       COMMON /FFIELDS_phiTide/ phiTide2d
3b540d7094 Jean*0097       COMMON /FFIELDS_pLoad/ pLoad
96243313d2 Patr*0098       COMMON /FFIELDS_sIceLoad/ sIceLoad
395b093796 Mart*0099 
42bd47f06f Chri*0100       _RS  fu       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0101       _RS  fv       (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
4edf45584c Alis*0102       _RS  Qnet     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
2dcaa8b9a5 Patr*0103       _RS  Qsw      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
9d424e3559 Alis*0104       _RS  EmPmR    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
3e01d879d6 Jean*0105       _RS  saltFlux (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
ab42872a05 Alis*0106       _RS  SST      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0107       _RS  SSS      (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
96243313d2 Patr*0108       _RS  lambdaThetaClimRelax(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0109       _RS  lambdaSaltClimRelax(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
8e1649be57 Jean*0110       _RS  phiTide2d(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
3b540d7094 Jean*0111       _RS  pLoad    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
b52bf74a5e Jean*0112       _RS  sIceLoad (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
4c84b0c69e Patr*0113 
701e10a905 Mart*0114 C     gcmSST :: model in-situ Sea Surface Temperature (SST); corresponds to
                0115 C               surface-level model variable "theta", except if using TEOS-10 ;
                0116 C               in that case a conversion from model Conservative Temperature
                0117 C               "theta" is applied. Note: not defined under an ice-shelf
                0118       COMMON /FFIELDS_INSITU_TEMP/ gcmSST
                0119       _RL  gcmSST(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0120 
9cd260ffd3 Jean*0121 #ifdef ALLOW_ADDFLUID
                0122       COMMON /FFIELDS_ADD_FLUID/ addMass
                0123       _RL addMass(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
ac957095b5 Patr*0124 #endif
434645f3d4 Jean*0125 #ifdef ALLOW_FRICTION_HEATING
                0126       COMMON /FFIELDS_frictionHeat/ frictionHeating
                0127       _RS frictionHeating(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0128 #endif
90929f8806 Patr*0129 #ifdef ALLOW_GEOTHERMAL_FLUX
                0130 C  geothermalFlux :: Upward geothermal flux through bottom cell [W/m^2]
                0131 C                    > 0 for increase in theta (ocean warming)
                0132 C                    Typical range: 0 < geothermalFlux < 1.5 W/m^2
                0133 C                    (global mean on the order 0.09 - 0.1 W/m^2)
                0134       COMMON /FFIELDS_geothermal/ geothermalFlux
                0135       _RS geothermalFlux(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0136 #endif
7e00d7e8f9 Jean*0137 #ifdef ALLOW_BALANCE_FLUXES
                0138 C  weight2BalanceFlx :: weight used for applying weighted correction
                0139 C                       to global-mean surf. flux imbalance ; no-units
                0140       COMMON /FFIELDS_W2BALANCE/ weight2BalanceFlx
                0141       _RS weight2BalanceFlx(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0142 #endif
3b540d7094 Jean*0143 
00c7090dc0 Mart*0144 #ifdef SHORTWAVE_HEATING
                0145 C     SWFrac3D :: fraction of solar short-wave flux penetrating the vertical
                0146 C                 cell interfaces (no units), function of depth of cell
                0147 C                 interface, potentially turbidity, cholorphyll concentration,
                0148 C                 or other biogeochemical material;
                0149 C                 the vertical dimension is Nr+1, because this makes it easier
                0150 C                 to maintain the symmetry w.r.t. z vs. p-coordinates.
                0151       COMMON /FFIELDS_SWFRAC/ SWFrac3D
                0152       _RS  SWFrac3D(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr+1,nSx,nSy)
                0153 #endif
9cd260ffd3 Jean*0154 
43af9695da Gael*0155 #ifdef ALLOW_EDDYPSI
434645f3d4 Jean*0156 C     uEulerMean  :: The Eulerian mean Zonal  velocity (residual less bolus velocity)
                0157 C     vEulerMean  :: The Eulerian mean Merid. velocity (residual less bolus velocity)
                0158 C     tauxEddy    :: The eddy stress used in the momentum equation of a residual model
                0159 C     tauyEddy    :: The eddy stress used in the momentum equation of a residual model
                0160 
                0161       COMMON /FFIELDS_eddyPsi_RS/ eddyPsiX, eddyPsiY
43af9695da Gael*0162       _RS  eddyPsiX (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0163       _RS  eddyPsiY (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
434645f3d4 Jean*0164 
                0165       COMMON /FFIELDS_eddyPsi_RL/
                0166      &                tauxEddy, tauyEddy, uEulerMean, vEulerMean
                0167       _RL tauxEddy  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0168       _RL tauyEddy  (1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0169       _RL uEulerMean(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0170       _RL vEulerMean(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,nSy)
                0171 #endif /* ALLOW_EDDYPSI */
ac957095b5 Patr*0172 
3b540d7094 Jean*0173 #ifndef EXCLUDE_FFIELDS_LOAD
632bf64d87 Jean*0174 C     loadedRec     :: time-record currently loaded (in temp arrays *[1])
1e273d1bf5 Jean*0175 C     taux[0,1]     :: Temp. for zonal wind stress
                0176 C     tauy[0,1]     :: Temp. for merid. wind stress
                0177 C     Qnet[0,1]     :: Temp. for heat flux
                0178 C     EmPmR[0,1]    :: Temp. for fresh water flux
                0179 C     saltFlux[0,1] :: Temp. for isurface salt flux
                0180 C     SST[0,1]      :: Temp. for theta climatalogy
                0181 C     SSS[0,1]      :: Temp. for theta climatalogy
                0182 C     Qsw[0,1]      :: Temp. for short wave component of heat flux
3b540d7094 Jean*0183 C     pLoad[0,1]    :: Temp. for atmospheric pressure at z=eta
1e273d1bf5 Jean*0184 C     [0,1]         :: End points for interpolation
7b35cd391f Jean*0185 
                0186       COMMON /FFIELDS_I/ loadedRec
                0187       INTEGER loadedRec(nSx,nSy)
650cc6304d Patr*0188 
                0189       COMMON /TDFIELDS/
                0190      &                 taux0, tauy0, Qnet0, EmPmR0, SST0, SSS0,
1e273d1bf5 Jean*0191      &                 taux1, tauy1, Qnet1, EmPmR1, SST1, SSS1,
                0192      &                 saltFlux0, saltFlux1
650cc6304d Patr*0193 #ifdef SHORTWAVE_HEATING
                0194      &               , Qsw0, Qsw1
3b540d7094 Jean*0195 #endif
8d218e2b5b suya*0196 #ifdef ALLOW_GEOTHERMAL_FLUX
80db5290f0 Jean*0197      &               , geothFlux0, geothFlux1
8d218e2b5b suya*0198 #endif
650cc6304d Patr*0199 #ifdef ATMOSPHERIC_LOADING
3b540d7094 Jean*0200      &               , pLoad0, pLoad1
650cc6304d Patr*0201 #endif
                0202 
                0203       _RS  taux0    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0204       _RS  tauy0    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0205       _RS  Qnet0    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0206       _RS  EmPmR0   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
1e273d1bf5 Jean*0207       _RS  saltFlux0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
650cc6304d Patr*0208       _RS  SST0     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0209       _RS  SSS0     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0210       _RS  taux1    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0211       _RS  tauy1    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0212       _RS  Qnet1    (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0213       _RS  EmPmR1   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
1e273d1bf5 Jean*0214       _RS  saltFlux1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
650cc6304d Patr*0215       _RS  SST1     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0216       _RS  SSS1     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0217 #ifdef SHORTWAVE_HEATING
                0218       _RS  Qsw0     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
80db5290f0 Jean*0219       _RS  Qsw1     (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
650cc6304d Patr*0220 #endif
8d218e2b5b suya*0221 #ifdef ALLOW_GEOTHERMAL_FLUX
80db5290f0 Jean*0222       _RS  geothFlux0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0223       _RS  geothFlux1(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0224 #endif
                0225 #ifdef ATMOSPHERIC_LOADING
                0226       _RS  pLoad0   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0227       _RS  pLoad1   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
8d218e2b5b suya*0228 #endif
3b540d7094 Jean*0229 #endif /* EXCLUDE_FFIELDS_LOAD */
650cc6304d Patr*0230 
7e1abc4cce Jean*0231 C     surfaceForcingU     units are  r_unit.m/s^2 (=m^2/s^2 if r=z)
                0232 C                -> usage in gU:     gU = gU + surfaceForcingU/drF [m/s^2]
                0233 C     surfaceForcingV     units are  r_unit.m/s^2 (=m^2/s^-2 if r=z)
                0234 C                -> usage in gU:     gV = gV + surfaceForcingV/drF [m/s^2]
4c84b0c69e Patr*0235 C
ba0b047096 Mart*0236 C     surfaceForcingS     units are  r_unit.g/kg/s (=g/kg.m/s if r=z)
7e1abc4cce Jean*0237 C            - EmPmR * S_surf plus salinity relaxation*drF(1)
ba0b047096 Mart*0238 C                -> usage in gS:     gS = gS + surfaceForcingS/drF [g/kg/s]
4c84b0c69e Patr*0239 C
7e1abc4cce Jean*0240 C     surfaceForcingT     units are  r_unit.Kelvin/s (=Kelvin.m/s if r=z)
                0241 C            - Qnet (+Qsw) plus temp. relaxation*drF(1)
4c84b0c69e Patr*0242 C                -> calculate        -lambda*(T(model)-T(clim))
7e1abc4cce Jean*0243 C            Qnet assumed to be net heat flux including ShortWave rad.
                0244 C                -> usage in gT:     gT = gT + surfaceforcingT/drF [K/s]
538310b333 Jean*0245 C     adjustColdSST_diag :: diagnostic field for how much too cold (below
                0246 C              Tfreezing) SST has been adjusted (with allowFreezing=T).
                0247 C              > 0 for increase of SST (up to Tfreezing).
                0248 C              Units are r_unit.K/s (=Kelvin.m/s if r=z).
                0249 C        Note: 1) allowFreezing option is a crude hack to fix too cold SST that
                0250 C              results from missing seaice component. It should never be used
                0251 C              with any seaice component, neither current seaice pkg (pkg/seaice
                0252 C              or pkg/thsice) nor a seaice component from atmos model when
                0253 C              coupled to it.
                0254 C              2) this diagnostic is currently used by KPP package (kpp_calc.F
                0255 C              and kpp_transport_t.F) although it is not very clear it should.
7e1abc4cce Jean*0256 
                0257       COMMON /SURFACE_FORCING/
                0258      &                         surfaceForcingU,
                0259      &                         surfaceForcingV,
                0260      &                         surfaceForcingT,
3b540d7094 Jean*0261      &                         surfaceForcingS,
538310b333 Jean*0262      &                         adjustColdSST_diag
7e1abc4cce Jean*0263       _RL  surfaceForcingU   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0264       _RL  surfaceForcingV   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0265       _RL  surfaceForcingT   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0266       _RL  surfaceForcingS   (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
538310b333 Jean*0267       _RL  adjustColdSST_diag(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
434645f3d4 Jean*0268 
14c6f9452b Jean*0269 C     botDragU :: bottom stress (for diagnostics), Zonal component
                0270 C                Units are N/m^2 ;   > 0 increase uVel @ bottom
                0271 C     botDragV :: bottom stress (for diagnostics), Merid. component
                0272 C                Units are N/m^2 ;   > 0 increase vVel @ bottom
                0273       COMMON /FFIELDS_bottomStress/ botDragU, botDragV
                0274       _RS  botDragU (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0275       _RS  botDragV (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
                0276 
434645f3d4 Jean*0277 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|