Changeset 26544


Ignore:
Timestamp:
11/04/21 16:26:20 (3 years ago)
Author:
dmenemen
Message:

updating code and code_4003 to MItgcm checkpoint68c+

Location:
issm/trunk-jpl/test/MITgcm
Files:
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/test/MITgcm/code/CPP_EEOPTIONS.h

    r23083 r26544  
    6262C     Use D0 where it means REAL*8 but not where it means REAL*16
    6363#define D0 d0
    64 
    65 C--   Enable some old macro conventions for backward compatibility
    66 #undef USE_OLD_MACROS_R4R8toRSRL
    6764
    6865C=== IO related options ===
  • issm/trunk-jpl/test/MITgcm/code/do_oceanic_phys.F

    r23083 r26544  
    11#include "PACKAGES_CONFIG.h"
    22#include "CPP_OPTIONS.h"
     3#ifdef ALLOW_MOM_COMMON
     4# include "MOM_COMMON_OPTIONS.h"
     5#endif
    36#ifdef ALLOW_AUTODIFF
    47# include "AUTODIFF_OPTIONS.h"
     
    7376C       |-- EXTERNAL_FORCING_SURF
    7477C       |
     78C       |-- OBCS_ADJUST
     79C       |
    7580C       |- k loop (Nr:1):
    7681C       | - DWNSLP_CALC_RHO
     
    119124C       |
    120125C       |-- KPP_DO_EXCH
     126C       |
     127C       |-- GGL90_EXCHANGES
    121128C       |
    122129C       |-- DIAGS_RHO_G
     
    143150#ifdef ALLOW_AUTODIFF
    144151# include "AUTODIFF_MYFIELDS.h"
    145 # include "tamc.h"
    146 # include "tamc_keys.h"
     152# ifdef ALLOW_AUTODIFF_TAMC
     153#  include "tamc.h"
     154# endif
    147155# include "FFIELDS.h"
    148156# include "SURFACE.h"
     
    196204C     !LOCAL VARIABLES:
    197205C     == Local variables
    198 C     rhoK, rhoKm1  :: Density at current level, and level above
     206C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
    199207C     iMin, iMax    :: Ranges and sub-block indices on which calculations
    200208C     jMin, jMax       are applied.
     
    202210C     msgBuf        :: Temp. for building output string
    203211C     i,j,k         :: loop indices
     212C     kSrf          :: surface index
    204213      _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
    205214      _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
     
    210219      INTEGER jMin, jMax
    211220      INTEGER bi, bj
    212       INTEGER i, j, k
     221      INTEGER i, j, k, kSrf
    213222      CHARACTER*(MAX_LEN_MBUF) msgBuf
    214223      INTEGER doDiagsRho
     
    221230      _RL thetaRef
    222231#endif /* ALLOW_AUTODIFF */
     232#ifdef ALLOW_AUTODIFF_TAMC
     233      INTEGER act1, act2, act3, act4
     234      INTEGER max1, max2, max3
     235      INTEGER kkey, itdkey
     236#endif
    223237CEOP
    224238
     
    227241      itdkey = 1
    228242#endif /* ALLOW_AUTODIFF_TAMC */
     243
     244      kSrf = 1
     245      IF ( usingPCoords ) kSrf = Nr
    229246
    230247#ifdef ALLOW_DEBUG
     
    282299
    283300#ifdef ALLOW_AUTODIFF
    284 # ifdef ALLOW_SALT_PLUME
    285301      DO bj=myByLo(myThid),myByHi(myThid)
    286302       DO bi=myBxLo(myThid),myBxHi(myThid)
    287303        DO j=1-OLy,sNy+OLy
    288304         DO i=1-OLx,sNx+OLx
     305          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
     306# ifdef ALLOW_SALT_PLUME
    289307          saltPlumeDepth(i,j,bi,bj) = 0. _d 0
    290308          saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
     309# endif
    291310         ENDDO
    292311        ENDDO
    293312       ENDDO
    294313      ENDDO
    295 # endif
    296 # ifdef ALLOW_ECCO
    297 #  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
    298       DO bj=myByLo(myThid),myByHi(myThid)
    299        DO bi=myBxLo(myThid),myBxHi(myThid)
    300         DO k=1,Nr
    301          DO j=1-OLy,sNy+OLy
    302           DO i=1-OLx,sNx+OLx
    303            sigmaRfield(i,j,k,bi,bj) = 0. _d 0
    304           ENDDO
    305          ENDDO
    306         ENDDO
    307        ENDDO
    308       ENDDO
    309 #  endif
    310 # endif
    311314#endif /* ALLOW_AUTODIFF */
    312315
     
    320323#endif /* ALLOW_FRAZIL */
    321324
    322 #ifndef OLD_THSICE_CALL_SEQUENCE
    323325#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
    324326      IF ( useThSIce .AND. fluidIsWater ) THEN
    325327# ifdef ALLOW_AUTODIFF_TAMC
    326 CADJ STORE uice,vice         = comlev1, key = ikey_dynamics,
    327 CADJ &     kind = isbyte
    328 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
    329 CADJ &     kind = isbyte
    330 CADJ STORE snowHeight, Tsrf  = comlev1, key = ikey_dynamics,
    331 CADJ &     kind = isbyte
    332 CADJ STORE Qice1, Qice2      = comlev1, key = ikey_dynamics,
    333 CADJ &     kind = isbyte
    334 CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics,
    335 CADJ &     kind = isbyte
    336 CADJ STORE hocemxl = comlev1, key = ikey_dynamics,
    337 CADJ &     kind = isbyte
    338 CADJ STORE icflxsw = comlev1, key = ikey_dynamics,
    339 CADJ &     kind = isbyte
    340 CADJ STORE salt,theta        = comlev1, key = ikey_dynamics,
    341 CADJ &     kind = isbyte
    342 CADJ STORE uvel,vvel         = comlev1, key = ikey_dynamics,
    343 CADJ &     kind = isbyte
    344 CADJ STORE qnet,qsw, empmr   = comlev1, key = ikey_dynamics,
    345 CADJ &     kind = isbyte
    346 CADJ STORE atemp,aqh,precip  = comlev1, key = ikey_dynamics,
    347 CADJ &     kind = isbyte
    348 CADJ STORE swdown,lwdown     = comlev1, key = ikey_dynamics,
    349 CADJ &     kind = isbyte
     328#  ifdef ALLOW_SEAICE
     329CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
     330#  endif
     331CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
     332CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
     333CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
     334CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
     335CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
     336CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
     337CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
     338CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
     339CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
     340CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
    350341#  ifdef NONLIN_FRSURF
    351 CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
    352 CADJ &     kind = isbyte
     342CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
    353343#  endif
    354344# endif /* ALLOW_AUTODIFF_TAMC */
     
    363353      ENDIF
    364354#endif /* ALLOW_THSICE */
    365 #endif /* ndef OLD_THSICE_CALL_SEQUENCE */
    366355
    367356#ifdef ALLOW_SEAICE
    368 # ifdef ALLOW_AUTODIFF
    369 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    370 CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
    371 CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
    372 CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
    373 CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    374 CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
     357# ifdef ALLOW_AUTODIFF_TAMC
     358CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
     359CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
     360CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
     361CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
     362CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
    375363#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
    376 CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
    377 #endif
    378       IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN
    379         CALL SEAICE_FAKE( myTime, myIter, myThid )
    380       ENDIF
    381 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    382 CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
    383 CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
    384 CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
    385 CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    386 CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
    387 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
    388 CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
    389 #endif
    390 # endif /* ALLOW_AUTODIFF */
    391 #endif /* ALLOW_SEAICE */
    392 
    393 #ifdef ALLOW_SEAICE
     364CADJ STORE evap  = comlev1, key=ikey_dynamics, kind=isbyte
     365#endif
     366# endif /* ALLOW_AUTODIFF_TAMC */
     367#ifdef ALLOW_AUTODIFF_TAMC
     368CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte
     369#endif
    394370      IF ( useSEAICE ) THEN
    395371# ifdef ALLOW_AUTODIFF_TAMC
    396 cph-adj-test(
    397 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    398 CADJ STORE hsnow  = comlev1, key=ikey_dynamics, kind=isbyte
    399 CADJ STORE heff   = comlev1, key=ikey_dynamics, kind=isbyte
    400 CADJ STORE tices  = comlev1, key=ikey_dynamics, kind=isbyte
    401 CADJ STORE empmr, qnet  = comlev1, key=ikey_dynamics, kind=isbyte
    402 CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte
    403 CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte
    404 cCADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    405 cCADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
    406 cph-adj-test)
    407 c#ifdef ALLOW_EXF
    408 CADJ STORE atemp,aqh,precip    = comlev1, key = ikey_dynamics,
    409 CADJ &     kind = isbyte
    410 CADJ STORE swdown,lwdown       = comlev1, key = ikey_dynamics,
    411 CADJ &     kind = isbyte
    412 CADJ STORE evap                = comlev1, key = ikey_dynamics,
    413 CADJ &     kind = isbyte
    414 CADJ STORE uwind,vwind         = comlev1, key = ikey_dynamics,
    415 CADJ &     kind = isbyte
    416 c#endif
    417 CADJ STORE uvel,vvel           = comlev1, key = ikey_dynamics,
    418 CADJ &     kind = isbyte
    419 #  ifdef SEAICE_CGRID
    420 CADJ STORE stressdivergencex   = comlev1, key = ikey_dynamics,
    421 CADJ &     kind = isbyte
    422 CADJ STORE stressdivergencey   = comlev1, key = ikey_dynamics,
    423 CADJ &     kind = isbyte
    424 #  endif
    425 #  ifdef SEAICE_ALLOW_DYNAMICS
    426 CADJ STORE uice                = comlev1, key = ikey_dynamics,
    427 CADJ &     kind = isbyte
    428 CADJ STORE vice                = comlev1, key = ikey_dynamics,
    429 CADJ &     kind = isbyte
    430 CADJ STORE dwatn               = comlev1, key = ikey_dynamics,
    431 CADJ &     kind = isbyte
    432 #   ifdef SEAICE_ALLOW_EVP
    433 CADJ STORE seaice_sigma1       = comlev1, key = ikey_dynamics,
    434 CADJ &     kind = isbyte
    435 CADJ STORE seaice_sigma2       = comlev1, key = ikey_dynamics,
    436 CADJ &     kind = isbyte
    437 CADJ STORE seaice_sigma12      = comlev1, key = ikey_dynamics,
    438 CADJ &     kind = isbyte
    439 #   endif
     372CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
     373CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
     374#  ifdef ALLOW_EXF
     375CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
     376CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
     377CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
    440378#  endif
    441379#  ifdef SEAICE_VARIABLE_SALINITY
    442 CADJ STORE hsalt               = comlev1, key = ikey_dynamics,
    443 CADJ &     kind = isbyte
     380CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
    444381#  endif
    445382#  ifdef ATMOSPHERIC_LOADING
    446 CADJ STORE pload               = comlev1, key = ikey_dynamics,
    447 CADJ &     kind = isbyte
    448 CADJ STORE siceload            = comlev1, key = ikey_dynamics,
    449 CADJ &     kind = isbyte
     383CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
    450384#  endif
    451385#  ifdef NONLIN_FRSURF
    452 CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
    453 CADJ &     kind = isbyte
     386CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
    454387#  endif
    455388#  ifdef ANNUAL_BALANCE
    456 CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
    457 CADJ &     kind = isbyte
     389CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
    458390#  endif /* ANNUAL_BALANCE */
    459391#  ifdef ALLOW_THSICE
    460 C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
    461 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
    462 CADJ &     kind = isbyte
    463 CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
    464 CADJ &     kind = isbyte
    465 CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
    466 CADJ &     kind = isbyte
     392C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
     393CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
     394CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
     395CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
    467396#  endif /* ALLOW_THSICE */
    468397# endif /* ALLOW_AUTODIFF_TAMC */
     
    473402        CALL SEAICE_MODEL( myTime, myIter, myThid )
    474403        CALL TIMER_STOP ('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
     404# ifdef ALLOW_AUTODIFF_TAMC
     405CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
     406CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
     407CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
     408CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
     409CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
     410CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
     411# endif
    475412# ifdef ALLOW_COST
    476413        CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
    477414# endif
     415# ifdef ALLOW_AUTODIFF
     416      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
     417CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
     418        CALL SEAICE_FAKE( myTime, myIter, myThid )
     419# endif /* ALLOW_AUTODIFF */
    478420      ENDIF
    479421#endif /* ALLOW_SEAICE */
     
    493435
    494436#ifdef ALLOW_AUTODIFF_TAMC
    495 CADJ STORE sst, sss           = comlev1, key = ikey_dynamics,
    496 CADJ &     kind = isbyte
    497 CADJ STORE qsw                = comlev1, key = ikey_dynamics,
    498 CADJ &     kind = isbyte
     437CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
     438CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
    499439# ifdef ALLOW_SEAICE
    500 CADJ STORE area               = comlev1, key = ikey_dynamics,
    501 CADJ &     kind = isbyte
    502 # endif
    503 #endif
    504 
    505 #ifdef OLD_THSICE_CALL_SEQUENCE
    506 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
    507       IF ( useThSIce .AND. fluidIsWater ) THEN
    508 # ifdef ALLOW_AUTODIFF_TAMC
    509 cph(
    510 #  ifdef NONLIN_FRSURF
    511 CADJ STORE uice,vice        = comlev1, key = ikey_dynamics,
    512 CADJ &     kind = isbyte
    513 CADJ STORE salt,theta       = comlev1, key = ikey_dynamics,
    514 CADJ &     kind = isbyte
    515 CADJ STORE qnet,qsw, empmr  = comlev1, key = ikey_dynamics,
    516 CADJ &     kind = isbyte
    517 CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
    518 CADJ &     kind = isbyte
    519 #  endif
    520 # endif
    521 # ifdef ALLOW_DEBUG
    522         IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
    523 # endif
    524 C--     Step forward Therm.Sea-Ice variables
    525 C       and modify forcing terms including effects from ice
    526         CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
    527         CALL THSICE_MAIN( myTime, myIter, myThid )
    528         CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
    529       ENDIF
    530 #endif /* ALLOW_THSICE */
    531 #endif /* OLD_THSICE_CALL_SEQUENCE */
     440CADJ STORE area              = comlev1, key=ikey_dynamics, kind=isbyte
     441# endif
     442#endif
    532443
    533444#ifdef ALLOW_CPL_ISSM
     
    541452#endif
    542453#ifdef ALLOW_AUTODIFF_TAMC
    543 CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
    544 CADJ &     kind = isbyte
    545 CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics,
    546 CADJ &     kind = isbyte
     454CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
     455CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
    547456#endif
    548457C     compute temperature and (virtual) salt flux at the
     
    574483      IF ( useSALT_PLUME ) THEN
    575484Catn: exchanging saltPlumeFlux:
    576           CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
     485        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
    577486      ENDIF
    578487#endif /* ALLOW_SALT_PLUME */
     
    581490      IF ( allowFreezing ) THEN
    582491#ifdef ALLOW_AUTODIFF_TAMC
    583 CADJ STORE theta = comlev1, key = ikey_dynamics,
    584 CADJ &     kind = isbyte
     492CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
    585493#endif
    586494        CALL FREEZE_SURFACE( myTime, myIter, myThid )
     
    595503C     relaxation terms, etc.
    596504#ifdef ALLOW_AUTODIFF
    597 CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
    598 CADJ &     kind = isbyte
     505CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
    599506#else  /* ALLOW_AUTODIFF */
    600507C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
     
    608515     I             iMin, iMax, jMin, jMax,
    609516     I             myTime, myIter, myThid )
     517
     518#ifdef  ALLOW_OBCS
     519      IF (useOBCS) THEN
     520C--   After all surface fluxes are known apply balancing fluxes and
     521C--   apply tidal forcing to open boundaries
     522# ifdef ALLOW_DEBUG
     523       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
     524# endif
     525       CALL OBCS_ADJUST(
     526     I      myTime+deltaTClock, myIter+1, myThid )
     527      ENDIF
     528#endif  /* ALLOW_OBCS */
    610529
    611530#ifdef ALLOW_AUTODIFF_TAMC
     
    645564           sigmaY(i,j,k) = 0. _d 0
    646565           sigmaR(i,j,k) = 0. _d 0
     566#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
     567           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
     568#endif
    647569          ENDDO
    648570         ENDDO
    649571        ENDDO
    650572
    651 #ifdef ALLOW_AUTODIFF
    652573        DO j=1-OLy,sNy+OLy
    653574         DO i=1-OLx,sNx+OLx
     
    656577         ENDDO
    657578        ENDDO
     579#ifdef ALLOW_AUTODIFF
    658580cph all the following init. are necessary for TAF
    659581cph although some of these are re-initialised later.
     
    697619           Kwy(i,j,k,bi,bj)  = 0. _d 0
    698620           Kwz(i,j,k,bi,bj)  = 0. _d 0
    699 #  ifdef GM_NON_UNITY_DIAGONAL
    700621           Kux(i,j,k,bi,bj)  = 0. _d 0
    701622           Kvy(i,j,k,bi,bj)  = 0. _d 0
    702 #  endif
    703623#  ifdef GM_EXTRA_DIAGONAL
    704624           Kuz(i,j,k,bi,bj)  = 0. _d 0
     
    736656
    737657#ifdef ALLOW_AUTODIFF_TAMC
    738 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    739 CADJ &     kind = isbyte
    740 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    741 CADJ &     kind = isbyte
     658CADJ STORE theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
     659CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
    742660CADJ STORE totphihyd(:,:,:,bi,bj)
    743 CADJ &     = comlev1_bibj, key=itdkey,
    744 CADJ &     kind = isbyte
     661CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
    745662# ifdef ALLOW_KPP
    746 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    747 CADJ &     kind = isbyte
    748 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    749 CADJ &     kind = isbyte
     663CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
     664CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
    750665# endif
    751666# ifdef ALLOW_SALT_PLUME
    752 CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
    753 CADJ &     kind = isbyte
    754 CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
    755 CADJ &     kind = isbyte
     667CADJ STORE saltplumedepth(:,:,bi,bj)
     668CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
     669CADJ STORE saltplumeflux(:,:,bi,bj)
     670CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
    756671# endif
    757672#endif /* ALLOW_AUTODIFF_TAMC */
     
    856771            IF (k.GT.1) THEN
    857772#ifdef ALLOW_AUTODIFF_TAMC
    858 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
    859 CADJ &     kind = isbyte
    860 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
    861 CADJ &     kind = isbyte
    862 CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,
    863 CADJ &     kind = isbyte
     773CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
     774CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
     775CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
    864776#endif /* ALLOW_AUTODIFF_TAMC */
    865              CALL FIND_RHO_2D(
     777             IF ( usingZCoords ) THEN
     778              DO j=jMin,jMax
     779               DO i=iMin,iMax
     780                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
     781               ENDDO
     782              ENDDO
     783              CALL FIND_RHO_2D(
    866784     I                 iMin, iMax, jMin, jMax, k,
    867785     I                 theta(1-OLx,1-OLy,k-1,bi,bj),
     
    869787     O                 rhoKm1,
    870788     I                 k-1, bi, bj, myThid )
     789             ELSE
     790              CALL FIND_RHO_2D(
     791     I                 iMin, iMax, jMin, jMax, k-1,
     792     I                 theta(1-OLx,1-OLy,k,bi,bj),
     793     I                 salt (1-OLx,1-OLy,k,bi,bj),
     794     O                 rhoKp1,
     795     I                 k, bi, bj, myThid )
     796              DO j=jMin,jMax
     797               DO i=iMin,iMax
     798                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
     799               ENDDO
     800              ENDDO
     801             ENDIF
    871802            ENDIF
    872803#ifdef ALLOW_DEBUG
    873804            IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
    874805#endif
    875 cph Avoid variable aliasing for adjoint !!!
    876             DO j=jMin,jMax
    877              DO i=iMin,iMax
    878               rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
    879              ENDDO
    880             ENDDO
    881806            CALL GRAD_SIGMA(
    882807     I             bi, bj, iMin, iMax, jMin, jMax, k,
     
    884809     O             sigmaX, sigmaY, sigmaR,
    885810     I             myThid )
    886 #ifdef ALLOW_ECCO
    887 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
     811
     812#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
    888813            DO j=jMin,jMax
    889814             DO i=iMin,iMax
     
    891816             ENDDO
    892817            ENDDO
    893 # endif
    894 #endif /* ALLOW_ECCO */
     818#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
     819
    895820#ifdef ALLOW_AUTODIFF
    896821#ifdef GMREDI_WITH_STABLE_ADJOINT
     
    929854#ifdef ALLOW_AUTODIFF_TAMC
    930855CADJ STORE IVDConvCount(:,:,:,bi,bj)
    931 CADJ &     = comlev1_bibj, key=itdkey,
    932 CADJ &     kind = isbyte
     856CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    933857#endif
    934858
     
    936860        IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
    937861          CALL CALC_OCE_MXLAYER(
    938      I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
     862     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
    939863     I              bi, bj, myTime, myIter, myThid )
    940864        ENDIF
     
    943867        IF ( useSALT_PLUME ) THEN
    944868          CALL SALT_PLUME_CALC_DEPTH(
    945      I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
     869     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
    946870     I              bi, bj, myTime, myIter, myThid )
    947871#ifdef SALT_PLUME_VOLUME
     
    950874C-- get forcings for kpp
    951875          CALL SALT_PLUME_APPLY(
    952      I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
     876     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
    953877     I              theta, 0,
    954878     I              myTime, myIter, myThid )
    955879          CALL SALT_PLUME_APPLY(
    956      I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
     880     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
    957881     I              salt, 0,
    958882     I              myTime, myIter, myThid )
     
    978902cph needed for KPP
    979903CADJ STORE surfaceForcingU(:,:,bi,bj)
    980 CADJ &     = comlev1_bibj, key=itdkey,
    981 CADJ &     kind = isbyte
     904CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    982905CADJ STORE surfaceForcingV(:,:,bi,bj)
    983 CADJ &     = comlev1_bibj, key=itdkey,
    984 CADJ &     kind = isbyte
     906CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    985907CADJ STORE surfaceForcingS(:,:,bi,bj)
    986 CADJ &     = comlev1_bibj, key=itdkey,
    987 CADJ &     kind = isbyte
     908CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    988909CADJ STORE surfaceForcingT(:,:,bi,bj)
    989 CADJ &     = comlev1_bibj, key=itdkey,
    990 CADJ &     kind = isbyte
    991 CADJ STORE surfaceForcingTice(:,:,bi,bj)
    992 CADJ &     = comlev1_bibj, key=itdkey,
    993 CADJ &     kind = isbyte
     910CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    994911#endif /* ALLOW_AUTODIFF_TAMC */
    995912
     
    1047964#ifdef  ALLOW_GGL90
    1048965#ifdef ALLOW_AUTODIFF_TAMC
    1049 CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    1050 CADJ &     kind = isbyte
     966CADJ STORE GGL90TKE(:,:,:,bi,bj)
     967CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    1051968#endif /* ALLOW_AUTODIFF_TAMC */
    1052969C--     Compute GGL90 mixing coefficients
    1053         IF (useGGL90) THEN
     970        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
    1054971#ifdef ALLOW_DEBUG
    1055972          IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
     
    1079996cph keep it although TAF says you dont need to.
    1080997cph but I have avoided the #ifdef for now, in case more things change
    1081 CADJ STORE sigmaX(:,:,:)        = comlev1_bibj, key=itdkey,
    1082 CADJ &     kind = isbyte
    1083 CADJ STORE sigmaY(:,:,:)        = comlev1_bibj, key=itdkey,
    1084 CADJ &     kind = isbyte
    1085 CADJ STORE sigmaR(:,:,:)        = comlev1_bibj, key=itdkey,
    1086 CADJ &     kind = isbyte
     998CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
     999CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
     1000CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
    10871001# endif
    10881002#endif /* ALLOW_AUTODIFF_TAMC */
     
    11661080#endif /* ALLOW_KPP */
    11671081
     1082#ifdef ALLOW_GGL90
     1083      IF ( useGGL90 )
     1084     &  CALL GGL90_EXCHANGES( myThid )
     1085#endif /* ALLOW_GGL90 */
     1086
    11681087#ifdef ALLOW_DIAGNOSTICS
    11691088      IF ( fluidIsWater .AND. useDiagnostics ) THEN
  • issm/trunk-jpl/test/MITgcm/code/eeboot_minimal.F

    r23083 r26544  
    4040      INTEGER myComm
    4141
     42C     !FUNCTIONS:
     43c     INTEGER  IFNBLNK
     44c     EXTERNAL IFNBLNK
     45      INTEGER  ILNBLNK
     46      EXTERNAL ILNBLNK
     47
    4248C     !LOCAL VARIABLES:
    4349C     == Local variables ==
     
    5864      LOGICAL doReport
    5965#if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
    60       INTEGER mpiMyWid
     66      INTEGER mpiMyWId
     67#elif defined(ALLOW_NEST2W_COMMON)
     68      INTEGER mpiMyWId
    6169#endif
    6270#ifdef ALLOW_CPL_ISSM
     
    6775#endif /* ALLOW_CPL_ISSM */
    6876#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
    69       INTEGER mpiMyWid, color
     77      INTEGER mpiMyWId, color
    7078#endif
    7179#ifdef USE_PDAF
    7280      INTEGER mpi_task_id
     81      CHARACTER*(14) fmtStr
     82#else
     83      CHARACTER*(6) fmtStr
    7384#endif /* USE_PDAF */
     85      INTEGER iTmp
    7486#endif /* ALLOW_USE_MPI */
    7587CEOP
     
    176188#endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
    177189
     190#ifdef ALLOW_NEST2W_COMMON
     191C--    Case with 2-Ways Nest(ing)
     192C-     Set the running directory
     193       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
     194       CALL SETDIR( mpiMyWId )
     195
     196C-     Setup Nesting Execution Environment
     197       CALL NEST2W_EEINIT( mpiMyWId )
     198       IF ( eeBootError ) GOTO 999
     199#endif /* ALLOW_NEST2W_COMMON */
     200
    178201#ifdef ALLOW_CPL_ISSM
    179202C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
     
    216239       ENDIF
    217240       myProcId = mpiMyId
     241       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
    218242#ifdef USE_PDAF
    219        WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
     243       WRITE(fmtStr,'(4(A,I1),A)')
     244     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
     245       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
    220246#else
    221        WRITE(myProcessStr,'(I4.4)') myProcId
     247       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
     248       WRITE(myProcessStr,fmtStr) myProcId
    222249#endif /* USE_PDAF */
     250       iTmp = ILNBLNK( myProcessStr )
    223251       mpiPidIo = myProcId
    224252       pidIO    = mpiPidIo
     
    227255        IF( myProcId .EQ. 0 ) THEN
    228256#endif
    229          WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
    230 #ifdef USE_PDAF
    231          WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
    232 #endif
     257         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
    233258         OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
    234          WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
    235 #ifdef USE_PDAF
    236          WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
    237 #endif
     259         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
    238260         OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
    239261#ifdef SINGLE_DISK_IO
  • issm/trunk-jpl/test/MITgcm/code/packages.conf

    r26542 r26544  
     1#-- list of packages (or group of packages) to compile for this experiment:
    12gfd
     3obcs
     4shelfice
     5diagnostics
    26timeave
    3 shelfice
    4 obcs
    5 diagnostics
  • issm/trunk-jpl/test/MITgcm/code_4003/CPP_EEOPTIONS.h

    r24121 r26544  
    6262C     Use D0 where it means REAL*8 but not where it means REAL*16
    6363#define D0 d0
    64 
    65 C--   Enable some old macro conventions for backward compatibility
    66 #undef USE_OLD_MACROS_R4R8toRSRL
    6764
    6865C=== IO related options ===
  • issm/trunk-jpl/test/MITgcm/code_4003/CPP_OPTIONS.h

    r24121 r26544  
    5454#define INCLUDE_PHIHYD_CALCULATION_CODE
    5555
     56C o Include/exclude sound speed calculation code
     57C o (Note that this is a diagnostic from Del Grasso algorithm, not derived from EOS)
     58#undef INCLUDE_SOUNDSPEED_CALC_CODE
     59
    5660C-- Vertical mixing code options:
    5761
     
    7478#undef EXCLUDE_PCELL_MIX_CODE
    7579
     80C o Exclude/allow to use isotropic 3-D Smagorinsky viscosity as diffusivity
     81C   for tracers (after scaling by constant Prandtl number)
     82#undef ALLOW_SMAG_3D_DIFFUSIVITY
     83
    7684C-- Time-stepping code options:
    7785
    7886C o Include/exclude combined Surf.Pressure and Drag Implicit solver code
    79 #undef ALLOW_SOLVE4_PS_AND_DRAG
     87#define ALLOW_SOLVE4_PS_AND_DRAG
    8088
    8189C o Include/exclude Implicit vertical advection code
     
    8492C o Include/exclude AdamsBashforth-3rd-Order code
    8593#undef ALLOW_ADAMSBASHFORTH_3
     94
     95C o Include/exclude Quasi-Hydrostatic Stagger Time-step AdamsBashforth code
     96#undef ALLOW_QHYD_STAGGER_TS
    8697
    8798C-- Model formulation options:
     
    94105C   this implies that grid-cell thickness (hFactors) varies with time
    95106#define NONLIN_FRSURF
     107C o Disable code for rStar coordinate and/or code for Sigma coordinate
     108c#define DISABLE_RSTAR_CODE
     109c#define DISABLE_SIGMA_CODE
    96110
    97111C o Include/exclude nonHydrostatic code
     
    103117C-- Algorithm options:
    104118
    105 C o Use Non Self-Adjoint (NSA) conjugate-gradient solver
     119C o Include/exclude code for Non Self-Adjoint (NSA) conjugate-gradient solver
    106120#undef ALLOW_CG2D_NSA
    107121
    108122C o Include/exclude code for single reduction Conjugate-Gradient solver
    109 #undef ALLOW_SRCG
     123#define ALLOW_SRCG
    110124
    111125C o Choices for implicit solver routines solve_*diagonal.F
    112126C   The following has low memory footprint, but not suitable for AD
    113 #undef SOLVE_DIAGONAL_LOWMEMORY
     127#define SOLVE_DIAGONAL_LOWMEMORY
    114128C   The following one suitable for AD but does not vectorize
    115129#undef SOLVE_DIAGONAL_KINNER
     
    117131C-- Retired code options:
    118132
     133C o ALLOW isotropic scaling of harmonic and bi-harmonic terms when
     134C   using an locally isotropic spherical grid with (dlambda) x (dphi*cos(phi))
     135C *only for use on a lat-lon grid*
     136C   Setting this flag here affects both momentum and tracer equation unless
     137C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
     138C   The definition of the flag is commented to avoid interference with
     139C   such other header files.
     140C   The preferred method is specifying a value for viscAhGrid or viscA4Grid
     141C   in data which is then automatically scaled by the grid size;
     142C   the old method of specifying viscAh/viscA4 and this flag is provided
     143C   for completeness only (and for use with the adjoint).
     144c#define ISOTROPIC_COS_SCALING
     145
     146C o This flag selects the form of COSINE(lat) scaling of bi-harmonic term.
     147C *only for use on a lat-lon grid*
     148C   Has no effect if ISOTROPIC_COS_SCALING is undefined.
     149C   Has no effect on vector invariant momentum equations.
     150C   Setting this flag here affects both momentum and tracer equation unless
     151C   it is set/unset again in other header fields (e.g., GAD_OPTIONS.h).
     152C   The definition of the flag is commented to avoid interference with
     153C   such other header files.
     154c#define COSINEMETH_III
     155
     156C o Use "OLD" UV discretisation near boundaries (*not* recommended)
     157C   Note - only works with pkg/mom_fluxform and "no_slip_sides=.FALSE."
     158C          because the old code did not have no-slip BCs
     159#undef OLD_ADV_BCS
     160
    119161C o Use LONG.bin, LATG.bin, etc., initialization for ini_curviliear_grid.F
    120162C   Default is to use "new" grid files (OLD_GRID_IO undef) but OLD_GRID_IO
    121163C   is still useful with, e.g., single-domain curvilinear configurations.
    122164#undef OLD_GRID_IO
     165
     166C o Use old EXTERNAL_FORCING_U,V,T,S subroutines (for backward compatibility)
     167#undef USE_OLD_EXTERNAL_FORCING
    123168
    124169C-- Other option files:
  • issm/trunk-jpl/test/MITgcm/code_4003/DIAGNOSTICS_SIZE.h

    r26543 r26544  
    2323      PARAMETER( diagSt_size = 10*Nr )
    2424
     25
    2526CEH3 ;;; Local Variables: ***
    2627CEH3 ;;; mode:fortran ***
  • issm/trunk-jpl/test/MITgcm/code_4003/DIAG_OPTIONS.h

    r24121 r26544  
    22#define DIAG_OPTIONS_H
    33#include "PACKAGES_CONFIG.h"
    4 #ifdef ALLOW_DIAGNOSTICS
    5 
    64#include "CPP_OPTIONS.h"
    75
    8 CEH3 package-specific options go here
     6#ifdef ALLOW_DIAGNOSTICS
     7C     Package-specific Options & Macros go here
    98
    109C allow to define specific regions and the corresponding mask ;
    1110C  used to perform regional statistics over a limited area
    12 #undef DIAGSTATS_REGION_MASK
     11#define DIAGSTATS_REGION_MASK
    1312
    1413C allow to stop & restart at any time (i.e. not at a multiple of
     
    1918#undef  DIAGNOSTICS_HAS_PICKUP
    2019
    21 C for NetCDF (mnc) output: define a missing value (default is UNSET_RL)
    22 C and fill land points of (so far only) scalar fields with it
    23 #undef DIAGNOSTICS_MISSING_VALUE
    24 
    2520#endif /* ALLOW_DIAGNOSTICS */
    2621#endif /* DIAG_OPTIONS_H */
    27 
    2822
    2923CEH3 ;;; Local Variables: ***
  • issm/trunk-jpl/test/MITgcm/code_4003/OBCS_OPTIONS.h

    r24121 r26544  
    11C CPP options file for OBCS package
    2 C
    32C Use this file for selecting options within the OBCS package
    4 C
    5 C OBCS is enabled with ALLOW_OBCS in CPP_OPTIONS.h
    63
    74#ifndef OBCS_OPTIONS_H
     
    118
    129#ifdef ALLOW_OBCS
     10C Package-specific Options & Macros go here
    1311
    1412C Enable individual open boundaries
     
    2523#define ALLOW_OBCS_PRESCRIBE
    2624
    27 C This includes hooks to sponge layer treatment of uvel, vvel
     25C Enable OB conditions following Stevens (1990)
     26#undef ALLOW_OBCS_STEVENS
     27
     28C Allow sponge layer treatment of open boundary conditions
    2829#define ALLOW_OBCS_SPONGE
    2930
     31C Include hooks to sponge layer treatment of pkg/seaice variables
     32#undef ALLOW_OBCS_SEAICE_SPONGE
     33
    3034C balance barotropic velocity
    31 C KS16 turn this on
    3235#define ALLOW_OBCS_BALANCE
    3336
     37C add tidal contributions to normal OB flow
     38C NOTE that at the moment tidal forcing is applied
     39C only to "normal" flow.
     40#undef ALLOW_OBCS_TIDES
     41
     42C Use older implementation of obcs in seaice-dynamics
     43C note: most of the "experimental" options listed below have not yet
     44C       been implementated in new version.
     45#undef OBCS_UVICE_OLD
     46
     47#ifdef OBCS_UVICE_OLD
    3448C     The following five CPP options are experimental and aim to deal
    3549C     with artifacts due to the low-frequency specification of sea-ice
     
    4660#undef OBCS_SEAICE_SMOOTH_UVICE_PAR
    4761
     62C     Compute rather than specify seaice velocities at the edges.
     63#undef OBCS_SEAICE_COMPUTE_UVICE
     64#endif /* OBCS_UVICE_OLD */
     65
    4866C     Smooth the tracer sea-ice variables near the edges.
    4967#undef OBCS_SEAICE_SMOOTH_EDGE
    5068
    51 C     Compute rather than specify seaice velocities at the edges.
    52 #undef OBCS_SEAICE_COMPUTE_UVICE
    53 
    5469#endif /* ALLOW_OBCS */
    5570#endif /* OBCS_OPTIONS_H */
  • issm/trunk-jpl/test/MITgcm/code_4003/SIZE.h

    r26542 r26544  
    4343      INTEGER Nr
    4444      PARAMETER (
    45      &           sNx =  3,
    46      &           sNy =  200,
     45     &           sNx =   1,
     46     &           sNy =  50,
    4747     &           OLx =   3,
    4848     &           OLy =   3,
    4949     &           nSx =   1,
    50      &           nSy =   1,
     50     &           nSy =   4,
    5151     &           nPx =   1,
    5252     &           nPy =   1,
  • issm/trunk-jpl/test/MITgcm/code_4003/do_oceanic_phys.F

    r24121 r26544  
    11#include "PACKAGES_CONFIG.h"
    22#include "CPP_OPTIONS.h"
     3#ifdef ALLOW_MOM_COMMON
     4# include "MOM_COMMON_OPTIONS.h"
     5#endif
    36#ifdef ALLOW_AUTODIFF
    47# include "AUTODIFF_OPTIONS.h"
     
    7376C       |-- EXTERNAL_FORCING_SURF
    7477C       |
     78C       |-- OBCS_ADJUST
     79C       |
    7580C       |- k loop (Nr:1):
    7681C       | - DWNSLP_CALC_RHO
     
    119124C       |
    120125C       |-- KPP_DO_EXCH
     126C       |
     127C       |-- GGL90_EXCHANGES
    121128C       |
    122129C       |-- DIAGS_RHO_G
     
    143150#ifdef ALLOW_AUTODIFF
    144151# include "AUTODIFF_MYFIELDS.h"
    145 # include "tamc.h"
    146 # include "tamc_keys.h"
     152# ifdef ALLOW_AUTODIFF_TAMC
     153#  include "tamc.h"
     154# endif
    147155# include "FFIELDS.h"
    148156# include "SURFACE.h"
     
    196204C     !LOCAL VARIABLES:
    197205C     == Local variables
    198 C     rhoK, rhoKm1  :: Density at current level, and level above
     206C     rhoKp1,rhoKm1 :: Density at current level, and @ level minus one
    199207C     iMin, iMax    :: Ranges and sub-block indices on which calculations
    200208C     jMin, jMax       are applied.
     
    202210C     msgBuf        :: Temp. for building output string
    203211C     i,j,k         :: loop indices
     212C     kSrf          :: surface index
    204213      _RL rhoKp1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
    205214      _RL rhoKm1  (1-OLx:sNx+OLx,1-OLy:sNy+OLy)
     
    210219      INTEGER jMin, jMax
    211220      INTEGER bi, bj
    212       INTEGER i, j, k
     221      INTEGER i, j, k, kSrf
    213222      CHARACTER*(MAX_LEN_MBUF) msgBuf
    214223      INTEGER doDiagsRho
     
    221230      _RL thetaRef
    222231#endif /* ALLOW_AUTODIFF */
     232#ifdef ALLOW_AUTODIFF_TAMC
     233      INTEGER act1, act2, act3, act4
     234      INTEGER max1, max2, max3
     235      INTEGER kkey, itdkey
     236#endif
    223237CEOP
    224238
     
    227241      itdkey = 1
    228242#endif /* ALLOW_AUTODIFF_TAMC */
     243
     244      kSrf = 1
     245      IF ( usingPCoords ) kSrf = Nr
    229246
    230247#ifdef ALLOW_DEBUG
     
    282299
    283300#ifdef ALLOW_AUTODIFF
    284 # ifdef ALLOW_SALT_PLUME
    285301      DO bj=myByLo(myThid),myByHi(myThid)
    286302       DO bi=myBxLo(myThid),myBxHi(myThid)
    287303        DO j=1-OLy,sNy+OLy
    288304         DO i=1-OLx,sNx+OLx
     305          adjustColdSST_diag(i,j,bi,bj) = 0. _d 0
     306# ifdef ALLOW_SALT_PLUME
    289307          saltPlumeDepth(i,j,bi,bj) = 0. _d 0
    290308          saltPlumeFlux(i,j,bi,bj)  = 0. _d 0
     309# endif
    291310         ENDDO
    292311        ENDDO
    293312       ENDDO
    294313      ENDDO
    295 # endif
    296 # ifdef ALLOW_ECCO
    297 #  ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
    298       DO bj=myByLo(myThid),myByHi(myThid)
    299        DO bi=myBxLo(myThid),myBxHi(myThid)
    300         DO k=1,Nr
    301          DO j=1-OLy,sNy+OLy
    302           DO i=1-OLx,sNx+OLx
    303            sigmaRfield(i,j,k,bi,bj) = 0. _d 0
    304           ENDDO
    305          ENDDO
    306         ENDDO
    307        ENDDO
    308       ENDDO
    309 #  endif
    310 # endif
    311314#endif /* ALLOW_AUTODIFF */
    312315
     
    320323#endif /* ALLOW_FRAZIL */
    321324
    322 #ifndef OLD_THSICE_CALL_SEQUENCE
    323325#if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
    324326      IF ( useThSIce .AND. fluidIsWater ) THEN
    325327# ifdef ALLOW_AUTODIFF_TAMC
    326 CADJ STORE uice,vice         = comlev1, key = ikey_dynamics,
    327 CADJ &     kind = isbyte
    328 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
    329 CADJ &     kind = isbyte
    330 CADJ STORE snowHeight, Tsrf  = comlev1, key = ikey_dynamics,
    331 CADJ &     kind = isbyte
    332 CADJ STORE Qice1, Qice2      = comlev1, key = ikey_dynamics,
    333 CADJ &     kind = isbyte
    334 CADJ STORE sHeating, snowAge = comlev1, key = ikey_dynamics,
    335 CADJ &     kind = isbyte
    336 CADJ STORE hocemxl = comlev1, key = ikey_dynamics,
    337 CADJ &     kind = isbyte
    338 CADJ STORE icflxsw = comlev1, key = ikey_dynamics,
    339 CADJ &     kind = isbyte
    340 CADJ STORE salt,theta        = comlev1, key = ikey_dynamics,
    341 CADJ &     kind = isbyte
    342 CADJ STORE uvel,vvel         = comlev1, key = ikey_dynamics,
    343 CADJ &     kind = isbyte
    344 CADJ STORE qnet,qsw, empmr   = comlev1, key = ikey_dynamics,
    345 CADJ &     kind = isbyte
    346 CADJ STORE atemp,aqh,precip  = comlev1, key = ikey_dynamics,
    347 CADJ &     kind = isbyte
    348 CADJ STORE swdown,lwdown     = comlev1, key = ikey_dynamics,
    349 CADJ &     kind = isbyte
     328#  ifdef ALLOW_SEAICE
     329CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
     330#  endif
     331CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
     332CADJ STORE snowHeight, Tsrf  = comlev1, key=ikey_dynamics, kind=isbyte
     333CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
     334CADJ STORE sHeating,snowAge  = comlev1, key=ikey_dynamics, kind=isbyte
     335CADJ STORE hocemxl, icflxsw  = comlev1, key=ikey_dynamics, kind=isbyte
     336CADJ STORE salt,theta        = comlev1, key=ikey_dynamics, kind=isbyte
     337CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
     338CADJ STORE qnet,qsw, empmr   = comlev1, key=ikey_dynamics, kind=isbyte
     339CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
     340CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
    350341#  ifdef NONLIN_FRSURF
    351 CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
    352 CADJ &     kind = isbyte
     342CADJ STORE hFac_surfC        = comlev1, key=ikey_dynamics, kind=isbyte
    353343#  endif
    354344# endif /* ALLOW_AUTODIFF_TAMC */
     
    363353      ENDIF
    364354#endif /* ALLOW_THSICE */
    365 #endif /* ndef OLD_THSICE_CALL_SEQUENCE */
    366355
    367356#ifdef ALLOW_SEAICE
    368 # ifdef ALLOW_AUTODIFF
    369 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    370 CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
    371 CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
    372 CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
    373 CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    374 CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
     357# ifdef ALLOW_AUTODIFF_TAMC
     358CADJ STORE qnet  = comlev1, key=ikey_dynamics, kind=isbyte
     359CADJ STORE qsw   = comlev1, key=ikey_dynamics, kind=isbyte
     360CADJ STORE theta = comlev1, key=ikey_dynamics, kind=isbyte
     361CADJ STORE salt  = comlev1, key=ikey_dynamics, kind=isbyte
     362CADJ STORE fu,fv = comlev1, key=ikey_dynamics, kind=isbyte
    375363#if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
    376 CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
    377 #endif
    378       IF ( .NOT.useSEAICE .AND. SEAICEadjMODE .EQ. -1 ) THEN
    379         CALL SEAICE_FAKE( myTime, myIter, myThid )
    380       ENDIF
    381 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    382 CADJ STORE fu,fv  = comlev1, key=ikey_dynamics, kind=isbyte
    383 CADJ STORE qnet   = comlev1, key=ikey_dynamics, kind=isbyte
    384 CADJ STORE qsw    = comlev1, key=ikey_dynamics, kind=isbyte
    385 CADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    386 CADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
    387 #if (defined ALLOW_EXF) && (defined ALLOW_ATM_TEMP)
    388 CADJ STORE evap   = comlev1, key=ikey_dynamics, kind=isbyte
    389 #endif
    390 # endif /* ALLOW_AUTODIFF */
    391 #endif /* ALLOW_SEAICE */
    392 
    393 #ifdef ALLOW_SEAICE
     364CADJ STORE evap  = comlev1, key=ikey_dynamics, kind=isbyte
     365#endif
     366# endif /* ALLOW_AUTODIFF_TAMC */
     367#ifdef ALLOW_AUTODIFF_TAMC
     368CADJ STORE phiHydLow= comlev1, key=ikey_dynamics, byte=isbyte
     369#endif
    394370      IF ( useSEAICE ) THEN
    395371# ifdef ALLOW_AUTODIFF_TAMC
    396 cph-adj-test(
    397 CADJ STORE area   = comlev1, key=ikey_dynamics, kind=isbyte
    398 CADJ STORE hsnow  = comlev1, key=ikey_dynamics, kind=isbyte
    399 CADJ STORE heff   = comlev1, key=ikey_dynamics, kind=isbyte
    400 CADJ STORE tices  = comlev1, key=ikey_dynamics, kind=isbyte
    401 CADJ STORE empmr, qnet  = comlev1, key=ikey_dynamics, kind=isbyte
    402 CADJ STORE qsw,saltflux = comlev1, key=ikey_dynamics, kind=isbyte
    403 CADJ STORE fu, fv = comlev1, key=ikey_dynamics, kind=isbyte
    404 cCADJ STORE theta  = comlev1, key=ikey_dynamics, kind=isbyte
    405 cCADJ STORE salt   = comlev1, key=ikey_dynamics, kind=isbyte
    406 cph-adj-test)
    407 c#ifdef ALLOW_EXF
    408 CADJ STORE atemp,aqh,precip    = comlev1, key = ikey_dynamics,
    409 CADJ &     kind = isbyte
    410 CADJ STORE swdown,lwdown       = comlev1, key = ikey_dynamics,
    411 CADJ &     kind = isbyte
    412 CADJ STORE evap                = comlev1, key = ikey_dynamics,
    413 CADJ &     kind = isbyte
    414 CADJ STORE uwind,vwind         = comlev1, key = ikey_dynamics,
    415 CADJ &     kind = isbyte
    416 c#endif
    417 CADJ STORE uvel,vvel           = comlev1, key = ikey_dynamics,
    418 CADJ &     kind = isbyte
    419 #  ifdef SEAICE_CGRID
    420 CADJ STORE stressdivergencex   = comlev1, key = ikey_dynamics,
    421 CADJ &     kind = isbyte
    422 CADJ STORE stressdivergencey   = comlev1, key = ikey_dynamics,
    423 CADJ &     kind = isbyte
    424 #  endif
    425 #  ifdef SEAICE_ALLOW_DYNAMICS
    426 CADJ STORE uice                = comlev1, key = ikey_dynamics,
    427 CADJ &     kind = isbyte
    428 CADJ STORE vice                = comlev1, key = ikey_dynamics,
    429 CADJ &     kind = isbyte
    430 CADJ STORE dwatn               = comlev1, key = ikey_dynamics,
    431 CADJ &     kind = isbyte
    432 #   ifdef SEAICE_ALLOW_EVP
    433 CADJ STORE seaice_sigma1       = comlev1, key = ikey_dynamics,
    434 CADJ &     kind = isbyte
    435 CADJ STORE seaice_sigma2       = comlev1, key = ikey_dynamics,
    436 CADJ &     kind = isbyte
    437 CADJ STORE seaice_sigma12      = comlev1, key = ikey_dynamics,
    438 CADJ &     kind = isbyte
    439 #   endif
     372CADJ STORE uvel,vvel         = comlev1, key=ikey_dynamics, kind=isbyte
     373CADJ STORE uice,vice         = comlev1, key=ikey_dynamics, kind=isbyte
     374#  ifdef ALLOW_EXF
     375CADJ STORE atemp,aqh,precip  = comlev1, key=ikey_dynamics, kind=isbyte
     376CADJ STORE swdown,lwdown     = comlev1, key=ikey_dynamics, kind=isbyte
     377CADJ STORE uwind,vwind       = comlev1, key=ikey_dynamics, kind=isbyte
    440378#  endif
    441379#  ifdef SEAICE_VARIABLE_SALINITY
    442 CADJ STORE hsalt               = comlev1, key = ikey_dynamics,
    443 CADJ &     kind = isbyte
     380CADJ STORE hsalt             = comlev1, key=ikey_dynamics, kind=isbyte
    444381#  endif
    445382#  ifdef ATMOSPHERIC_LOADING
    446 CADJ STORE pload               = comlev1, key = ikey_dynamics,
    447 CADJ &     kind = isbyte
    448 CADJ STORE siceload            = comlev1, key = ikey_dynamics,
    449 CADJ &     kind = isbyte
     383CADJ STORE pload, siceload   = comlev1, key=ikey_dynamics, kind=isbyte
    450384#  endif
    451385#  ifdef NONLIN_FRSURF
    452 CADJ STORE recip_hfacc         = comlev1, key = ikey_dynamics,
    453 CADJ &     kind = isbyte
     386CADJ STORE recip_hfacc       = comlev1, key=ikey_dynamics, kind=isbyte
    454387#  endif
    455388#  ifdef ANNUAL_BALANCE
    456 CADJ STORE balance_itcount     = comlev1, key = ikey_dynamics,
    457 CADJ &     kind = isbyte
     389CADJ STORE balance_itcount   = comlev1, key=ikey_dynamics, kind=isbyte
    458390#  endif /* ANNUAL_BALANCE */
    459391#  ifdef ALLOW_THSICE
    460 C-- store thSIce vars before advection (called from SEAICE_MODEL) update them:
    461 CADJ STORE iceMask,iceHeight = comlev1, key = ikey_dynamics,
    462 CADJ &     kind = isbyte
    463 CADJ STORE snowHeight, hOceMxL = comlev1, key = ikey_dynamics,
    464 CADJ &     kind = isbyte
    465 CADJ STORE Qice1, Qice2  = comlev1, key = ikey_dynamics,
    466 CADJ &     kind = isbyte
     392C-- store thSIce vars before advection (called from SEAICE_MODEL) updates them:
     393CADJ STORE iceMask,iceHeight = comlev1, key=ikey_dynamics, kind=isbyte
     394CADJ STORE snowHeight,hOceMxL= comlev1, key=ikey_dynamics, kind=isbyte
     395CADJ STORE Qice1, Qice2      = comlev1, key=ikey_dynamics, kind=isbyte
    467396#  endif /* ALLOW_THSICE */
    468397# endif /* ALLOW_AUTODIFF_TAMC */
     
    473402        CALL SEAICE_MODEL( myTime, myIter, myThid )
    474403        CALL TIMER_STOP ('SEAICE_MODEL    [DO_OCEANIC_PHYS]', myThid)
     404# ifdef ALLOW_AUTODIFF_TAMC
     405CADJ STORE tices = comlev1, key=ikey_dynamics, kind=isbyte
     406CADJ STORE heff  = comlev1, key=ikey_dynamics, kind=isbyte
     407CADJ STORE hsnow = comlev1, key=ikey_dynamics, kind=isbyte
     408CADJ STORE area  = comlev1, key=ikey_dynamics, kind=isbyte
     409CADJ STORE uIce  = comlev1, key=ikey_dynamics, kind=isbyte
     410CADJ STORE vIce  = comlev1, key=ikey_dynamics, kind=isbyte
     411# endif
    475412# ifdef ALLOW_COST
    476413        CALL SEAICE_COST_SENSI ( myTime, myIter, myThid )
    477414# endif
     415# ifdef ALLOW_AUTODIFF
     416      ELSEIF ( SEAICEadjMODE .EQ. -1 ) THEN
     417CADJ STORE area = comlev1, key=ikey_dynamics, kind=isbyte
     418        CALL SEAICE_FAKE( myTime, myIter, myThid )
     419# endif /* ALLOW_AUTODIFF */
    478420      ENDIF
    479421#endif /* ALLOW_SEAICE */
     
    493435
    494436#ifdef ALLOW_AUTODIFF_TAMC
    495 CADJ STORE sst, sss           = comlev1, key = ikey_dynamics,
    496 CADJ &     kind = isbyte
    497 CADJ STORE qsw                = comlev1, key = ikey_dynamics,
    498 CADJ &     kind = isbyte
     437CADJ STORE sst, sss          = comlev1, key=ikey_dynamics, kind=isbyte
     438CADJ STORE qsw               = comlev1, key=ikey_dynamics, kind=isbyte
    499439# ifdef ALLOW_SEAICE
    500 CADJ STORE area               = comlev1, key = ikey_dynamics,
    501 CADJ &     kind = isbyte
    502 # endif
    503 #endif
    504 
    505 #ifdef OLD_THSICE_CALL_SEQUENCE
    506 #if (defined ALLOW_THSICE) && !(defined ALLOW_ATM2D)
    507       IF ( useThSIce .AND. fluidIsWater ) THEN
    508 # ifdef ALLOW_AUTODIFF_TAMC
    509 cph(
    510 #  ifdef NONLIN_FRSURF
    511 CADJ STORE uice,vice        = comlev1, key = ikey_dynamics,
    512 CADJ &     kind = isbyte
    513 CADJ STORE salt,theta       = comlev1, key = ikey_dynamics,
    514 CADJ &     kind = isbyte
    515 CADJ STORE qnet,qsw, empmr  = comlev1, key = ikey_dynamics,
    516 CADJ &     kind = isbyte
    517 CADJ STORE hFac_surfC       = comlev1, key = ikey_dynamics,
    518 CADJ &     kind = isbyte
    519 #  endif
    520 # endif
    521 # ifdef ALLOW_DEBUG
    522         IF (debugMode) CALL DEBUG_CALL('THSICE_MAIN',myThid)
    523 # endif
    524 C--     Step forward Therm.Sea-Ice variables
    525 C       and modify forcing terms including effects from ice
    526         CALL TIMER_START('THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
    527         CALL THSICE_MAIN( myTime, myIter, myThid )
    528         CALL TIMER_STOP( 'THSICE_MAIN     [DO_OCEANIC_PHYS]', myThid)
    529       ENDIF
    530 #endif /* ALLOW_THSICE */
    531 #endif /* OLD_THSICE_CALL_SEQUENCE */
     440CADJ STORE area              = comlev1, key=ikey_dynamics, kind=isbyte
     441# endif
     442#endif
    532443
    533444#ifdef ALLOW_CPL_ISSM
     
    541452#endif
    542453#ifdef ALLOW_AUTODIFF_TAMC
    543 CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
    544 CADJ &     kind = isbyte
    545 CADJ STORE uvel, vvel = comlev1, key = ikey_dynamics,
    546 CADJ &     kind = isbyte
     454CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
     455CADJ STORE uvel, vvel        = comlev1, key=ikey_dynamics, kind=isbyte
    547456#endif
    548457C     compute temperature and (virtual) salt flux at the
     
    574483      IF ( useSALT_PLUME ) THEN
    575484Catn: exchanging saltPlumeFlux:
    576           CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
     485        CALL SALT_PLUME_DO_EXCH( myTime, myIter, myThid )
    577486      ENDIF
    578487#endif /* ALLOW_SALT_PLUME */
     
    581490      IF ( allowFreezing ) THEN
    582491#ifdef ALLOW_AUTODIFF_TAMC
    583 CADJ STORE theta = comlev1, key = ikey_dynamics,
    584 CADJ &     kind = isbyte
     492CADJ STORE theta             = comlev1, key=ikey_dynamics, kind=isbyte
    585493#endif
    586494        CALL FREEZE_SURFACE( myTime, myIter, myThid )
     
    595503C     relaxation terms, etc.
    596504#ifdef ALLOW_AUTODIFF
    597 CADJ STORE salt, theta = comlev1, key = ikey_dynamics,
    598 CADJ &     kind = isbyte
     505CADJ STORE salt, theta       = comlev1, key=ikey_dynamics, kind=isbyte
    599506#else  /* ALLOW_AUTODIFF */
    600507C--   if fluid is not water, by-pass surfaceForcing, find_rho, gmredi
     
    608515     I             iMin, iMax, jMin, jMax,
    609516     I             myTime, myIter, myThid )
     517
     518#ifdef  ALLOW_OBCS
     519      IF (useOBCS) THEN
     520C--   After all surface fluxes are known apply balancing fluxes and
     521C--   apply tidal forcing to open boundaries
     522# ifdef ALLOW_DEBUG
     523       IF (debugMode) CALL DEBUG_CALL('OBCS_ADJUST',myThid)
     524# endif
     525       CALL OBCS_ADJUST(
     526     I      myTime+deltaTClock, myIter+1, myThid )
     527      ENDIF
     528#endif  /* ALLOW_OBCS */
    610529
    611530#ifdef ALLOW_AUTODIFF_TAMC
     
    645564           sigmaY(i,j,k) = 0. _d 0
    646565           sigmaR(i,j,k) = 0. _d 0
     566#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
     567           sigmaRfield(i,j,k,bi,bj) = 0. _d 0
     568#endif
    647569          ENDDO
    648570         ENDDO
    649571        ENDDO
    650572
    651 #ifdef ALLOW_AUTODIFF
    652573        DO j=1-OLy,sNy+OLy
    653574         DO i=1-OLx,sNx+OLx
     
    656577         ENDDO
    657578        ENDDO
     579#ifdef ALLOW_AUTODIFF
    658580cph all the following init. are necessary for TAF
    659581cph although some of these are re-initialised later.
     
    697619           Kwy(i,j,k,bi,bj)  = 0. _d 0
    698620           Kwz(i,j,k,bi,bj)  = 0. _d 0
    699 #  ifdef GM_NON_UNITY_DIAGONAL
    700621           Kux(i,j,k,bi,bj)  = 0. _d 0
    701622           Kvy(i,j,k,bi,bj)  = 0. _d 0
    702 #  endif
    703623#  ifdef GM_EXTRA_DIAGONAL
    704624           Kuz(i,j,k,bi,bj)  = 0. _d 0
     
    736656
    737657#ifdef ALLOW_AUTODIFF_TAMC
    738 CADJ STORE theta(:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    739 CADJ &     kind = isbyte
    740 CADJ STORE salt (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    741 CADJ &     kind = isbyte
     658CADJ STORE theta(:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
     659CADJ STORE salt (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
    742660CADJ STORE totphihyd(:,:,:,bi,bj)
    743 CADJ &     = comlev1_bibj, key=itdkey,
    744 CADJ &     kind = isbyte
     661CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
    745662# ifdef ALLOW_KPP
    746 CADJ STORE uvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    747 CADJ &     kind = isbyte
    748 CADJ STORE vvel (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    749 CADJ &     kind = isbyte
     663CADJ STORE uvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
     664CADJ STORE vvel (:,:,:,bi,bj)  = comlev1_bibj, key=itdkey, kind=isbyte
    750665# endif
    751666# ifdef ALLOW_SALT_PLUME
    752 CADJ STORE saltplumedepth(:,:,bi,bj) = comlev1_bibj, key=itdkey,
    753 CADJ &     kind = isbyte
    754 CADJ STORE saltplumeflux(:,:,bi,bj) = comlev1_bibj, key=itdkey,
    755 CADJ &     kind = isbyte
     667CADJ STORE saltplumedepth(:,:,bi,bj)
     668CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
     669CADJ STORE saltplumeflux(:,:,bi,bj)
     670CADJ &                         = comlev1_bibj, key=itdkey, kind=isbyte
    756671# endif
    757672#endif /* ALLOW_AUTODIFF_TAMC */
     
    856771            IF (k.GT.1) THEN
    857772#ifdef ALLOW_AUTODIFF_TAMC
    858 CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
    859 CADJ &     kind = isbyte
    860 CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,
    861 CADJ &     kind = isbyte
    862 CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,
    863 CADJ &     kind = isbyte
     773CADJ STORE theta(:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
     774CADJ STORE salt (:,:,k-1,bi,bj) = comlev1_bibj_k, key=kkey,kind=isbyte
     775CADJ STORE rhokm1 (bi,bj)       = comlev1_bibj_k, key=kkey,kind=isbyte
    864776#endif /* ALLOW_AUTODIFF_TAMC */
    865              CALL FIND_RHO_2D(
     777             IF ( usingZCoords ) THEN
     778              DO j=jMin,jMax
     779               DO i=iMin,iMax
     780                rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
     781               ENDDO
     782              ENDDO
     783              CALL FIND_RHO_2D(
    866784     I                 iMin, iMax, jMin, jMax, k,
    867785     I                 theta(1-OLx,1-OLy,k-1,bi,bj),
     
    869787     O                 rhoKm1,
    870788     I                 k-1, bi, bj, myThid )
     789             ELSE
     790              CALL FIND_RHO_2D(
     791     I                 iMin, iMax, jMin, jMax, k-1,
     792     I                 theta(1-OLx,1-OLy,k,bi,bj),
     793     I                 salt (1-OLx,1-OLy,k,bi,bj),
     794     O                 rhoKp1,
     795     I                 k, bi, bj, myThid )
     796              DO j=jMin,jMax
     797               DO i=iMin,iMax
     798                rhoKm1(i,j) = rhoInSitu(i,j,k-1,bi,bj)
     799               ENDDO
     800              ENDDO
     801             ENDIF
    871802            ENDIF
    872803#ifdef ALLOW_DEBUG
    873804            IF (debugMode) CALL DEBUG_CALL('GRAD_SIGMA',myThid)
    874805#endif
    875 cph Avoid variable aliasing for adjoint !!!
    876             DO j=jMin,jMax
    877              DO i=iMin,iMax
    878               rhoKp1(i,j) = rhoInSitu(i,j,k,bi,bj)
    879              ENDDO
    880             ENDDO
    881806            CALL GRAD_SIGMA(
    882807     I             bi, bj, iMin, iMax, jMin, jMax, k,
     
    884809     O             sigmaX, sigmaY, sigmaR,
    885810     I             myThid )
    886 #ifdef ALLOW_ECCO
    887 # ifdef ALLOW_SIGMAR_COST_CONTRIBUTION
     811
     812#if (defined (ALLOW_SIGMAR_COST_CONTRIBUTION) || defined (ALLOW_LEITH_QG))
    888813            DO j=jMin,jMax
    889814             DO i=iMin,iMax
     
    891816             ENDDO
    892817            ENDDO
    893 # endif
    894 #endif /* ALLOW_ECCO */
     818#endif /* ALLOW_SIGMAR_COST_CONTRIBUTION or ALLOW_LEITH_QG */
     819
    895820#ifdef ALLOW_AUTODIFF
    896821#ifdef GMREDI_WITH_STABLE_ADJOINT
     
    929854#ifdef ALLOW_AUTODIFF_TAMC
    930855CADJ STORE IVDConvCount(:,:,:,bi,bj)
    931 CADJ &     = comlev1_bibj, key=itdkey,
    932 CADJ &     kind = isbyte
     856CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    933857#endif
    934858
     
    936860        IF ( calcGMRedi .OR. MOD(doDiagsRho,2).EQ.1 ) THEN
    937861          CALL CALC_OCE_MXLAYER(
    938      I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
     862     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
    939863     I              bi, bj, myTime, myIter, myThid )
    940864        ENDIF
     
    943867        IF ( useSALT_PLUME ) THEN
    944868          CALL SALT_PLUME_CALC_DEPTH(
    945      I              rhoInSitu(1-OLx,1-OLy,1,bi,bj), sigmaR,
     869     I              rhoInSitu(1-OLx,1-OLy,kSrf,bi,bj), sigmaR,
    946870     I              bi, bj, myTime, myIter, myThid )
    947871#ifdef SALT_PLUME_VOLUME
     
    950874C-- get forcings for kpp
    951875          CALL SALT_PLUME_APPLY(
    952      I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
     876     I              1, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
    953877     I              theta, 0,
    954878     I              myTime, myIter, myThid )
    955879          CALL SALT_PLUME_APPLY(
    956      I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,1,bi,bj),
     880     I              2, bi, bj, recip_hFacC(1-OLx,1-OLy,kSrf,bi,bj),
    957881     I              salt, 0,
    958882     I              myTime, myIter, myThid )
     
    978902cph needed for KPP
    979903CADJ STORE surfaceForcingU(:,:,bi,bj)
    980 CADJ &     = comlev1_bibj, key=itdkey,
    981 CADJ &     kind = isbyte
     904CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    982905CADJ STORE surfaceForcingV(:,:,bi,bj)
    983 CADJ &     = comlev1_bibj, key=itdkey,
    984 CADJ &     kind = isbyte
     906CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    985907CADJ STORE surfaceForcingS(:,:,bi,bj)
    986 CADJ &     = comlev1_bibj, key=itdkey,
    987 CADJ &     kind = isbyte
     908CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    988909CADJ STORE surfaceForcingT(:,:,bi,bj)
    989 CADJ &     = comlev1_bibj, key=itdkey,
    990 CADJ &     kind = isbyte
    991 CADJ STORE surfaceForcingTice(:,:,bi,bj)
    992 CADJ &     = comlev1_bibj, key=itdkey,
    993 CADJ &     kind = isbyte
     910CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    994911#endif /* ALLOW_AUTODIFF_TAMC */
    995912
     
    1047964#ifdef  ALLOW_GGL90
    1048965#ifdef ALLOW_AUTODIFF_TAMC
    1049 CADJ STORE GGL90TKE (:,:,:,bi,bj) = comlev1_bibj, key=itdkey,
    1050 CADJ &     kind = isbyte
     966CADJ STORE GGL90TKE(:,:,:,bi,bj)
     967CADJ &     = comlev1_bibj, key=itdkey, kind=isbyte
    1051968#endif /* ALLOW_AUTODIFF_TAMC */
    1052969C--     Compute GGL90 mixing coefficients
    1053         IF (useGGL90) THEN
     970        IF ( useGGL90 .AND. Nr.GT.1 ) THEN
    1054971#ifdef ALLOW_DEBUG
    1055972          IF (debugMode) CALL DEBUG_CALL('GGL90_CALC',myThid)
     
    1079996cph keep it although TAF says you dont need to.
    1080997cph but I have avoided the #ifdef for now, in case more things change
    1081 CADJ STORE sigmaX(:,:,:)        = comlev1_bibj, key=itdkey,
    1082 CADJ &     kind = isbyte
    1083 CADJ STORE sigmaY(:,:,:)        = comlev1_bibj, key=itdkey,
    1084 CADJ &     kind = isbyte
    1085 CADJ STORE sigmaR(:,:,:)        = comlev1_bibj, key=itdkey,
    1086 CADJ &     kind = isbyte
     998CADJ STORE sigmaX(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
     999CADJ STORE sigmaY(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
     1000CADJ STORE sigmaR(:,:,:)       = comlev1_bibj, key=itdkey, kind=isbyte
    10871001# endif
    10881002#endif /* ALLOW_AUTODIFF_TAMC */
     
    11661080#endif /* ALLOW_KPP */
    11671081
     1082#ifdef ALLOW_GGL90
     1083      IF ( useGGL90 )
     1084     &  CALL GGL90_EXCHANGES( myThid )
     1085#endif /* ALLOW_GGL90 */
     1086
    11681087#ifdef ALLOW_DIAGNOSTICS
    11691088      IF ( fluidIsWater .AND. useDiagnostics ) THEN
  • issm/trunk-jpl/test/MITgcm/code_4003/eeboot_minimal.F

    r24121 r26544  
    4040      INTEGER myComm
    4141
     42C     !FUNCTIONS:
     43c     INTEGER  IFNBLNK
     44c     EXTERNAL IFNBLNK
     45      INTEGER  ILNBLNK
     46      EXTERNAL ILNBLNK
     47
    4248C     !LOCAL VARIABLES:
    4349C     == Local variables ==
     
    5864      LOGICAL doReport
    5965#if defined(ALLOW_OASIS) || defined(COMPONENT_MODULE)
    60       INTEGER mpiMyWid
     66      INTEGER mpiMyWId
     67#elif defined(ALLOW_NEST2W_COMMON)
     68      INTEGER mpiMyWId
    6169#endif
    6270#ifdef ALLOW_CPL_ISSM
     
    6775#endif /* ALLOW_CPL_ISSM */
    6876#if defined(ALLOW_NEST_PARENT) || defined(ALLOW_NEST_CHILD)
    69       INTEGER mpiMyWid, color
     77      INTEGER mpiMyWId, color
    7078#endif
    7179#ifdef USE_PDAF
    7280      INTEGER mpi_task_id
     81      CHARACTER*(14) fmtStr
     82#else
     83      CHARACTER*(6) fmtStr
    7384#endif /* USE_PDAF */
     85      INTEGER iTmp
    7486#endif /* ALLOW_USE_MPI */
    7587CEOP
     
    176188#endif /* ALLOW_NEST_PARENT | ALLOW_NEST_CHILD */
    177189
     190#ifdef ALLOW_NEST2W_COMMON
     191C--    Case with 2-Ways Nest(ing)
     192C-     Set the running directory
     193       CALL MPI_COMM_RANK( MPI_COMM_WORLD, mpiMyWId, mpiRC )
     194       CALL SETDIR( mpiMyWId )
     195
     196C-     Setup Nesting Execution Environment
     197       CALL NEST2W_EEINIT( mpiMyWId )
     198       IF ( eeBootError ) GOTO 999
     199#endif /* ALLOW_NEST2W_COMMON */
     200
    178201#ifdef ALLOW_CPL_ISSM
    179202C     add a 1rst preliminary call EESET_PARAMS to set useCoupler
     
    216239       ENDIF
    217240       myProcId = mpiMyId
     241       iTmp = MAX(4,1 + INT(LOG10(DFLOAT(nPx*nPy))))
    218242#ifdef USE_PDAF
    219        WRITE(myProcessStr,'(I4.4,A1,I4.4)') mpi_task_id,'.',myProcId
     243       WRITE(fmtStr,'(4(A,I1),A)')
     244     &      '(I',iTmp,'.',iTmp,',A1,I',iTmp,'.',iTmp,')'
     245       WRITE(myProcessStr,fmtStr) mpi_task_id,'.',myProcId
    220246#else
    221        WRITE(myProcessStr,'(I4.4)') myProcId
     247       WRITE(fmtStr,'(2(A,I1),A)') '(I',iTmp,'.',iTmp,')'
     248       WRITE(myProcessStr,fmtStr) myProcId
    222249#endif /* USE_PDAF */
     250       iTmp = ILNBLNK( myProcessStr )
    223251       mpiPidIo = myProcId
    224252       pidIO    = mpiPidIo
     
    227255        IF( myProcId .EQ. 0 ) THEN
    228256#endif
    229          WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:4)
    230 #ifdef USE_PDAF
    231          WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:9)
    232 #endif
     257         WRITE(fNam,'(A,A)') 'STDERR.', myProcessStr(1:iTmp)
    233258         OPEN(errorMessageUnit,FILE=fNam,STATUS='unknown')
    234          WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:4)
    235 #ifdef USE_PDAF
    236          WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:9)
    237 #endif
     259         WRITE(fNam,'(A,A)') 'STDOUT.', myProcessStr(1:iTmp)
    238260         OPEN(standardMessageUnit,FILE=fNam,STATUS='unknown')
    239261#ifdef SINGLE_DISK_IO
  • issm/trunk-jpl/test/MITgcm/code_4003/packages.conf

    r26452 r26544  
     1#-- list of packages (or group of packages) to compile for this experiment:
    12gfd
     3obcs
    24shelfice
    3 obcs
    45diagnostics
  • issm/trunk-jpl/test/MITgcm/code_4003/shelfice_step_icemass.F

    r26453 r26544  
    4545C     i,j, bi,bj  :: loop indices
    4646      INTEGER bi,bj,i,j
     47#ifdef ALLOW_CPL_ISSM
    4748      _RL  issm_density
    4849      issm_density = 917.
     50#endif /* ALLOW_CPL_ISSM */
    4951
    5052      IF ( SHELFICEMassStepping ) THEN
Note: See TracChangeset for help on using the changeset viewer.