Back to home page

MITgcm

 
 

    


File indexing completed on 2026-09-07 05:08:32 UTC

view on githubraw file Latest commit d861cd50 on 2026-09-06 15:41:07 UTC
ced0783fba Jean*0001 #include "CHEAPAML_OPTIONS.h"
                0002 
6f955c5285 Jean*0003 CBOP
                0004 C     !ROUTINE: CHEAPAML_LANL_FLUX
                0005 C     !INTERFACE:
                0006       SUBROUTINE CHEAPAML_LANL_FLUX(
d861cd501f Jean*0007      I                    i,j,bi,bj, iceOrNot,
                0008      I                    tSurf, windSq,
                0009      O                    fsha, flha, evp, xolw, ssqt, q100,
                0010      O                    cdq, cdu,
                0011 c    O                    dSensdTs, dEvapdTs, dLWdTs, dQAdTs,
                0012      I                    myIter, myThid )
6f955c5285 Jean*0013 
                0014 C     !DESCRIPTION:
                0015 C     ==================================================================
                0016 C     SUBROUTINE cheapaml_LANL_flux
                0017 C     ==================================================================
                0018 C     o compute surface fluxes using LANL algorithms
                0019 
                0020 C     !USES:
                0021       IMPLICIT NONE
                0022 C     === Global variables ===
ced0783fba Jean*0023 #include "SIZE.h"
6f955c5285 Jean*0024 #include "EEPARAMS.h"
ced0783fba Jean*0025 #include "PARAMS.h"
                0026 #include "CHEAPAML.h"
                0027 
6f955c5285 Jean*0028 C     !INPUT PARAMETERS:
d861cd501f Jean*0029 C     i, j     :: local indices of current grid-point
                0030 C     bi, bj   :: current tile indices
                0031 C     iceOrNot :: 0=open water, 1=ice cover, 2=ice+snow
                0032 C     tSurf    :: surface temperature
                0033 C     windSq   :: relative wind (vs surface motion) speed square
                0034 C     myIter   :: Current iteration number in simulation
                0035 C     myThid   :: My Thread Id number
6f955c5285 Jean*0036       INTEGER i,j,bi,bj
d861cd501f Jean*0037       INTEGER iceOrNot
                0038       _RL tSurf (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0039       _RL windSq(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
                0040       INTEGER myIter, myThid
                0041 
6f955c5285 Jean*0042 C     !OUTPUT PARAMETERS:
d861cd501f Jean*0043 C     fsha   :: sensible heat flux
                0044 C     flha   :: latent heat flux
                0045 C     evp    :: evaporation
                0046 C     xolw   :: oceanic upwelled long wave radiation
                0047 C     ssqt   :: sat. specific humidity at atm layer top
                0048 C     cdq    :: evaporation coeff
                0049 C     cdu    :: surface drag coeff (for wind stress)
                0050       _RL fsha, flha, evp, xolw, ssqt, q100, cdq, cdu
                0051 C     derivative vs surf. temp of Sensible, Evap, LW, q100
                0052 c     _RL dSensdTs, dEvapdTs, dLWdTs, dQAdTs
6f955c5285 Jean*0053 CEOP
                0054 
d861cd501f Jean*0055 C     Other Input (in common block):
                0056 C       Tair :: mean air temperature (K)  at height ht (m)
                0057 C       qair :: Specific humidity kg/kg
6f955c5285 Jean*0058 
                0059 C     !LOCAL VARIABLES:
                0060       _RL deltaTm
d861cd501f Jean*0061       _RL uss, usm
6f955c5285 Jean*0062       _RL cheapaml_BulkCdn
d861cd501f Jean*0063       _RL t0, QaR
6f955c5285 Jean*0064       _RL ssq, q
                0065       _RL deltap, delq, pt, psx100, z100ol
d861cd501f Jean*0066       _RL rdn, ren, rhn, zice, zref
                0067       _RL rd, re, rh, tta, ttas, toa, ttt
                0068       _RL ustar, tstar, qstar, ht, hu, hq
                0069       _RL aln, cdalton, czol, psim_fac
                0070       _RL huol, stable, xsq, x, psimh, psixh
6f955c5285 Jean*0071       _RL clha, csha
                0072       INTEGER niter_bulk,iter
                0073 
                0074 C useful values
                0075 C hardwire atmospheric relative humidity at 80%
d861cd501f Jean*0076         QaR = 0.8 _d 0
6f955c5285 Jean*0077 C factor to compute rainfall from specific humidity
                0078 C inverse of time step
d861cd501f Jean*0079         deltaTm = 1. _d 0/deltaT
6f955c5285 Jean*0080 C reference values to compute turbulent flux
d861cd501f Jean*0081         ht = zt
                0082         hq = zq
                0083         hu = zu
                0084         zref = zt
                0085         zice = .0005 _d 0
                0086         aln = log(ht/zref)
6f955c5285 Jean*0087 C for iterating on turbulence
d861cd501f Jean*0088         niter_bulk = 5
                0089         cdalton = 0.0346000 _d 0
                0090         czol = zref*xkar*gravity
                0091         psim_fac = 5. _d 0
ced0783fba Jean*0092 
6f955c5285 Jean*0093 C     determine wind stress
d861cd501f Jean*0094         IF ( .NOT.useStressOption ) THEN
                0095           uss = SQRT( windSq(i,j) )
                0096           usm = MAX( uss, 1. _d 0 )
                0097           cheapaml_BulkCdn = cdrag_1/usm + cdrag_2 + cdrag_3*usm
                0098           cdu = rhoa*cheapaml_BulkCdn*uss
                0099         ELSE
                0100           usm = 1. _d 0
                0101         ENDIF
6f955c5285 Jean*0102 C diabatic and freshwater flux forcing
d861cd501f Jean*0103         toa = celsius2K + tSurf(i,j)
                0104         tta = celsius2K + Tair(i,j,bi,bj)
                0105         ttas = tta+gamma_blk*zref
                0106         ttt = tta - ( cheaphgrid(i,j,bi,bj) - zref )*gamma_blk
                0107         pt = p0*( oneRL -gamma_blk*cheaphgrid(i,j,bi,bj)/ttas )
                0108      &          **(gravity/gamma_blk/gasR)
ced0783fba Jean*0109 
6f955c5285 Jean*0110 C specific humidities
d861cd501f Jean*0111         ssq  = ssq0*exp( lath*(ssq1-ssq2/toa) ) / p0
                0112         ssqt = ssq0*exp( lath*(ssq1-ssq2/ttt) ) / pt
6f955c5285 Jean*0113 C     saturation no more at the top:
d861cd501f Jean*0114         ssqt = 0.7 _d 0*ssq
ced0783fba Jean*0115 
d861cd501f Jean*0116         IF (useFreshWaterFlux) THEN
                0117           q = qair(i,j,bi,bj)
                0118         ELSE
                0119           q = QaR * ssq
                0120         ENDIF
6f955c5285 Jean*0121 
                0122 C adjust temperature from reference height to formula height
d861cd501f Jean*0123 c       deltap = t  - to + gamma_blk*(zref-ht)
                0124         deltap = Tair(i,j,bi,bj) - tSurf(i,j) + gamma_blk*(zref-ht)
                0125         delq   = q - ssq
                0126         ttas   = tta + gamma_blk*(zref-ht)
                0127         t0     = ttas*(oneRL + humid_fac*q)
ced0783fba Jean*0128 
6f955c5285 Jean*0129 C initialize estimate exchange coefficients
d861cd501f Jean*0130         rdn = xkar/(log(zref/zice))
                0131         rhn = rdn
                0132         ren = rdn
6f955c5285 Jean*0133 C calculate turbulent scales
d861cd501f Jean*0134         ustar = rdn*usm
                0135         tstar = rhn*deltap
                0136         qstar = ren*delq
6f955c5285 Jean*0137 
                0138 C iteration with psi-functions to find transfer coefficients
d861cd501f Jean*0139         DO iter=1,niter_bulk
                0140           huol  = czol/ustar**2
                0141      &          *( tstar/t0 + qstar/(oneRL/humid_fac+q) )
                0142           huol  = SIGN( MIN(ABS(huol),10. _d 0), huol)
                0143           stable = halfRL + SIGN( halfRL, huol)
                0144           xsq = MAX( SQRT(ABS(oneRL - 16. _d 0*huol)), oneRL )
                0145           x     = SQRT(xsq)
                0146           psimh = -5. _d 0*huol*stable
                0147      &          + (oneRL-stable)*( twoRL*LOG(halfRL*(oneRL+x))
                0148      &                           + twoRL*LOG(halfRL*(oneRL+xsq))
                0149      &                           - twoRL*ATAN(x) + pi*halfRL )
                0150           psixh = -5. _d 0*huol*stable
                0151      &          + (oneRL-stable)*(twoRL*LOG(halfRL*(oneRL+xsq)))
ced0783fba Jean*0152 
6f955c5285 Jean*0153 C Update the transfer coefficients
d861cd501f Jean*0154           rd = rdn/(oneRL + rdn*(aln-psimh)/xkar)
                0155           rh = rhn/(oneRL + rhn*(aln-psixh)/xkar)
                0156           re = rh
6f955c5285 Jean*0157 C  Update ustar, tstar, qstar using updated, shifted coefficients.
d861cd501f Jean*0158           ustar = rd*usm
                0159           qstar = re*delq
                0160           tstar = rh*deltap
                0161         ENDDO
6f955c5285 Jean*0162 
d861cd501f Jean*0163         usm = MAX( uss, 0.5 _d 0 )
                0164         csha = rhoa*cpair*usm*rh*rd
                0165         clha = rhoa*lath*usm*re*rd
6f955c5285 Jean*0166 
d861cd501f Jean*0167         fsha = csha*deltap
                0168         flha = clha*delq
                0169         evp  = -flha/lath
                0170         cdq  =  clha/lath
ced0783fba Jean*0171 
6f955c5285 Jean*0172 C the sensible and latent heat fluxes, fsha and flha,
                0173 C are computed so that positive values are downward.
                0174 C the convention for cheapaml is upward fluxes are positive,
                0175 C so they must be multiplied by -1
d861cd501f Jean*0176         fsha = -fsha
                0177         flha = -flha
ced0783fba Jean*0178 
6f955c5285 Jean*0179 C oceanic upwelled long wave
d861cd501f Jean*0180         xolw = stefan*(toa)**4
6f955c5285 Jean*0181 C compute specific humidity at 100m
d861cd501f Jean*0182         huol   = czol/ustar**2
                0183      &         * ( tstar/t0 + qstar/(oneRL/humid_fac+q) )
                0184         huol   = SIGN( MIN(ABS(huol),10. _d 0), huol)
                0185         stable = halfRL + SIGN( halfRL, huol)
                0186         z100ol = 100. _d 0 *xkar*gravity/ustar**2
                0187      &         * ( tstar/t0 + qstar/(oneRL/humid_fac+q) )
                0188         xsq = MAX( SQRT(ABS( oneRL - 16. _d 0*z100ol)), oneRL )
                0189 c       x   = SQRT(xsq)
                0190         psx100 = -5. _d 0*z100ol*stable
                0191      &         + (oneRL-stable)*(twoRL*log(halfRL*(oneRL+xsq)))
                0192         q100 = ssq + qstar*( log(100. _d 0/zice) - psx100 )
ced0783fba Jean*0193 
                0194       RETURN
                0195       END