Back to home page

MITgcm

 
 

    


File indexing completed on 2023-09-03 05:10:16 UTC

view on githubraw file Latest commit 74487008 on 2023-09-03 01:50:18 UTC
6d54cf9ca1 Ed H*0001 #include "EXF_OPTIONS.h"
3a255f48df Gael*0002 #ifdef ALLOW_CTRL
                0003 # include "CTRL_OPTIONS.h"
                0004 #endif
                0005 #ifdef ALLOW_ECCO
                0006 # include "ECCO_OPTIONS.h"
                0007 #endif
7f861c1808 Patr*0008 
32e4056e6a Jean*0009       SUBROUTINE EXF_GETCLIM(
                0010      I                        myTime, myIter, myThid )
7f861c1808 Patr*0011 
                0012 c     ==================================================================
                0013 c     SUBROUTINE exf_getclim
                0014 c     ==================================================================
                0015 c
                0016 c     o Get the climatogy fields for the current time step. The switches
                0017 c       for the inclusion of the individual forcing components have to
6d54cf9ca1 Ed H*0018 c       be set in EXF_OPTIONS.h .
7f861c1808 Patr*0019 c
                0020 c       A note on surface fluxes:
                0021 c
3daafce20b Jean*0022 c       The MITgcm-UV vertical coordinate z is positive upward.
7f861c1808 Patr*0023 c       This implies that a positive flux is out of the ocean
                0024 c       model. However, the wind stress forcing is not treated
                0025 c       this way. A positive zonal wind stress accelerates the
                0026 c       model ocean towards the east.
                0027 c
                0028 c     started: Ralf.Giering@FastOpt.de 25-Mai-2000
                0029 c
                0030 c     ==================================================================
                0031 c     SUBROUTINE exf_getclim
                0032 c     ==================================================================
                0033 
32e4056e6a Jean*0034       IMPLICIT NONE
7f861c1808 Patr*0035 
                0036 c     == global variables ==
                0037 #include "EEPARAMS.h"
                0038 #include "SIZE.h"
e827bcc9ed Patr*0039 #include "GRID.h"
0320e25227 Mart*0040 #include "PARAMS.h"
fc0e2247b0 Patr*0041 #ifdef ALLOW_BULK_OFFLINE
                0042 # include "DYNVARS.h"
                0043 #endif
e834928899 Patr*0044 #include "EXF_PARAM.h"
                0045 #include "EXF_CONSTANTS.h"
30fcb891cf Jean*0046 #include "EXF_INTERP_SIZE.h"
                0047 #include "EXF_INTERP_PARAM.h"
082e18c36c Jean*0048 #include "EXF_FIELDS.h"
7f861c1808 Patr*0049 
                0050 c     == routine arguments ==
                0051 
32e4056e6a Jean*0052 c     myThid - thread number for this instance of the routine.
7f861c1808 Patr*0053 
32e4056e6a Jean*0054       _RL     myTime
                0055       INTEGER myIter
                0056       INTEGER myThid
7f861c1808 Patr*0057 
                0058 c     == local variables ==
                0059 
9f5240b52a Jean*0060       INTEGER ks
                0061 #if (defined ALLOW_CLIMSST_RELAXATION || defined ALLOW_BULK_OFFLINE )
                0062       INTEGER i, j, bi, bj
                0063 #endif
e827bcc9ed Patr*0064 
7f861c1808 Patr*0065 c     == end of interface ==
                0066 
0320e25227 Mart*0067       ks = 1
                0068       IF ( usingPCoords ) ks = Nr
                0069 
7f861c1808 Patr*0070 #ifdef ALLOW_CLIMSST_RELAXATION
                0071 c     Get values of climatological sst fields.
8a0f942cd7 Jean*0072       CALL EXF_SET_FLD(
                0073      I     'climsst', climsstfile, climsstmask,
d078fa0cf5 Jean*0074      I     climsstStartTime, climsstperiod, climsstRepCycle,
8a0f942cd7 Jean*0075      I     exf_inscal_climsst,
                0076      I     climsst_exfremo_intercept, climsst_exfremo_slope,
                0077      U     climsst, climsst0, climsst1,
e834928899 Patr*0078 #ifdef USE_EXF_INTERPOLATION
8a0f942cd7 Jean*0079      I     climsst_lon0, climsst_lon_inc, climsst_lat0, climsst_lat_inc,
                0080      I     climsst_nlon, climsst_nlat, xC, yC, climsst_interpMethod,
e834928899 Patr*0081 #endif
8a0f942cd7 Jean*0082      I     myTime, myIter, myThid )
4aa4270510 Jean*0083 
32e4056e6a Jean*0084       DO bj = myByLo(myThid),myByHi(myThid)
edf9251fd4 Jean*0085        DO bi = myBxLo(myThid),myBxHi(myThid)
32e4056e6a Jean*0086         DO j = 1,sNy
                0087          DO i = 1,sNx
                0088             IF (climsst(i,j,bi,bj) .LT. climtempfreeze) THEN
da380894cf Patr*0089                climsst(i,j,bi,bj) = climtempfreeze
32e4056e6a Jean*0090             ENDIF
                0091          ENDDO
                0092         ENDDO
                0093        ENDDO
                0094       ENDDO
7f861c1808 Patr*0095 c--   Update the tile edges.
32e4056e6a Jean*0096       _EXCH_XY_RL(climsst, myThid)
9f5240b52a Jean*0097 #endif /* ALLOW_CLIMSST_RELAXATION */
7f861c1808 Patr*0098 
                0099 #ifdef ALLOW_CLIMSSS_RELAXATION
e834928899 Patr*0100 c     Get values of climatological sss fields.
8a0f942cd7 Jean*0101       CALL EXF_SET_FLD(
                0102      I     'climsss', climsssfile, climsssmask,
d078fa0cf5 Jean*0103      I     climsssStartTime, climsssperiod, climsssRepCycle,
8a0f942cd7 Jean*0104      I     exf_inscal_climsss,
                0105      I     climsss_exfremo_intercept, climsss_exfremo_slope,
                0106      U     climsss, climsss0, climsss1,
e834928899 Patr*0107 #ifdef USE_EXF_INTERPOLATION
8a0f942cd7 Jean*0108      I     climsss_lon0, climsss_lon_inc, climsss_lat0, climsss_lat_inc,
                0109      I     climsss_nlon, climsss_nlat, xC, yC, climsss_interpMethod,
b6445f0d85 Patr*0110 #endif
8a0f942cd7 Jean*0111      I     myTime, myIter, myThid )
b6445f0d85 Patr*0112 c--   Update the tile edges.
32e4056e6a Jean*0113       _EXCH_XY_RL(climsss, myThid)
b6445f0d85 Patr*0114 #endif
d6f04f5673 Patr*0115 
de9be302a8 Patr*0116 #ifdef ALLOW_CLIMSTRESS_RELAXATION
                0117 c     Get values of climatological ustr fields.
32e4056e6a Jean*0118       CALL EXF_SET_UV (
8a0f942cd7 Jean*0119      I     'climustr', climustrfile, climustrmask,
d078fa0cf5 Jean*0120      I     climustrStartTime, climustrperiod, climustrRepCycle,
4aa4270510 Jean*0121      I     exf_inscal_climustr,
                0122      I     climustr_exfremo_intercept, climustr_exfremo_slope,
8a0f942cd7 Jean*0123      U     climustr, climustr0, climustr1,
                0124      I     'climvstr', climvstrfile, climvstrmask,
d078fa0cf5 Jean*0125      I     climvstrStartTime, climvstrperiod, climvstrRepCycle,
4aa4270510 Jean*0126      I     exf_inscal_climvstr,
                0127      I     climvstr_exfremo_intercept, climvstr_exfremo_slope,
8a0f942cd7 Jean*0128      U     climvstr, climvstr0, climvstr1,
4aa4270510 Jean*0129 #ifdef USE_EXF_INTERPOLATION
                0130      I     climustr_lon0, climustr_lon_inc,
                0131      I     climustr_lat0, climustr_lat_inc,
                0132      I     climustr_nlon, climustr_nlat, climustr_interpMethod,
                0133      I     climvstr_lon0, climvstr_lon_inc,
                0134      I     climvstr_lat0, climvstr_lat_inc,
                0135      I     climvstr_nlon, climvstr_nlat, climvstr_interpMethod,
3444f6eca1 Jean*0136      I     uvInterp_climstr,
4aa4270510 Jean*0137 #endif
32e4056e6a Jean*0138      I     myTime, myIter, myThid )
4aa4270510 Jean*0139 
de9be302a8 Patr*0140       CALL EXCH_UV_XY_RL( climustr, climvstr, .TRUE., myThid )
                0141 #endif /* CLIMSTRESS_RELAXATION */
                0142 
fc0e2247b0 Patr*0143 #ifdef ALLOW_BULK_OFFLINE
                0144       DO bj=myByLo(myThid),myByHi(myThid)
                0145        DO bi=myBxLo(myThid),myBxHi(myThid)
32e4056e6a Jean*0146          DO j=1-OLy,sNy+OLy
                0147           DO i=1-OLx,sNx+OLx
c5308dc7f3 Patr*0148 # ifdef ALLOW_CLIMSST_RELAXATION
32e4056e6a Jean*0149            IF ( climsstfile .NE. ' ' .AND.
eab183b640 Patr*0150      &          climsstperiod .NE. 0. )
0320e25227 Mart*0151      &          theta(i,j,ks,bi,bj) = climsst(i,j,bi,bj)
c5308dc7f3 Patr*0152 # endif
                0153 # ifdef ALLOW_CLIMSSS_RELAXATION
32e4056e6a Jean*0154            IF ( climsssfile .NE. ' ' .AND.
eab183b640 Patr*0155      &          climsssperiod .NE. 0. )
0320e25227 Mart*0156      &          salt(i,j,ks,bi,bj) = climsss(i,j,bi,bj)
c5308dc7f3 Patr*0157 # endif
de9be302a8 Patr*0158 # ifdef ALLOW_CLIMSTRESS_RELAXATION
32e4056e6a Jean*0159            IF ( climustrfile .NE. ' ' .AND.
eab183b640 Patr*0160      &          climustrperiod .NE. 0. )
0320e25227 Mart*0161      &          uVel(i,j,ks,bi,bj) = climustr(i,j,bi,bj)
32e4056e6a Jean*0162            IF ( climvstrfile .NE. ' ' .AND.
eab183b640 Patr*0163      &          climvstrperiod .NE. 0. )
0320e25227 Mart*0164      &          vVel(i,j,ks,bi,bj) = climvstr(i,j,bi,bj)
de9be302a8 Patr*0165 # endif
0320e25227 Mart*0166            IF ( myIter .EQ. nIter0 ) THEN
                0167               IF ( maskC(i,j,ks,bi,bj) .NE. 0. .AND.
                0168      &             theta(i,j,ks,bi,bj) .EQ. 0. ) THEN
                0169                 print *, 'ph-warn-exf-clim ', i, j, theta(i,j,ks,bi,bj)
fc0e2247b0 Patr*0170 cph                STOP 'in exf_getclim'
32e4056e6a Jean*0171               ENDIF
                0172            ENDIF
fc0e2247b0 Patr*0173           ENDDO
                0174          ENDDO
                0175        ENDDO
                0176       ENDDO
                0177 #endif /* ALLOW_BULK_OFFLINE */
b6445f0d85 Patr*0178 
4aa4270510 Jean*0179       RETURN
                0180       END